Browse Source

lint fixes

pull/81/head
MadeTech Dushan 3 years ago
parent
commit
f0f75dc48f
  1. 3
      app/controllers/users/passwords_controller.rb
  2. 8
      config/environments/development.rb
  3. 1
      db/migrate/20211112105348_add_incref_field.rb
  4. 9
      lib/tasks/form_definition.rake

3
app/controllers/users/passwords_controller.rb

@ -1,5 +1,4 @@
class Users::PasswordsController < Devise::PasswordsController
def reset_confirmation
@email = params["email"]
render "devise/confirmations/reset"
@ -14,7 +13,7 @@ class Users::PasswordsController < Devise::PasswordsController
protected
def after_sending_reset_password_instructions_path_for(resource)
def after_sending_reset_password_instructions_path_for(_resource)
confirmations_reset_path(email: params.dig("user", "email")) if is_navigational_format?
end
end

8
config/environments/development.rb

@ -44,14 +44,14 @@ Rails.application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
address: "smtp.gmail.com",
port: 465,
domain: 'gmail.com',
domain: "gmail.com",
user_name: ENV["CORE_EMAIL_USERNAME"],
password: ENV["CORE_EMAIL_PASSWORD"],
authentication: 'plain',
authentication: "plain",
enable_starttls_auto: true,
ssl: true
ssl: true,
}
# Print deprecation notices to the Rails logger.

1
db/migrate/20211112105348_add_incref_field.rb

@ -5,4 +5,3 @@ class AddIncrefField < ActiveRecord::Migration[6.1]
end
end
end

9
lib/tasks/form_definition.rake

@ -1,6 +1,6 @@
require "json"
require "json-schema"
# rubocop:disable Lint/ShadowingOuterLocalVariable
def get_all_form_paths(directories)
form_paths = []
directories.each do |directory|
@ -13,8 +13,8 @@ end
namespace :form_definition do
desc "Validate JSON against Generic Form Schema"
task :validate do
puts "#{Rails.root}"
task validate: :environment do
puts Rails.root.to_s
path = "config/forms/schema/generic.json"
file = File.open(path)
@ -38,7 +38,7 @@ namespace :form_definition do
file = File.open(path)
data = JSON.parse(file.read)
puts JSON::Validator.fully_validate(schema, data, :strict => true)
puts JSON::Validator.fully_validate(schema, data, strict: true)
begin
JSON::Validator.validate!(schema, data)
@ -48,3 +48,4 @@ namespace :form_definition do
end
end
end
# rubocop:enable Lint/ShadowingOuterLocalVariable

Loading…
Cancel
Save