Browse Source

Rubocop

pull/58/head
baarkerlounger 4 years ago
parent
commit
c031434bb2
  1. 1
      app/admin/admin_users.rb
  2. 2
      app/admin/dashboard.rb
  3. 2
      app/admin/income_ranges.rb
  4. 1
      app/models/income_range.rb
  5. 2
      config/initializers/active_admin.rb
  6. 4
      config/initializers/devise.rb
  7. 1
      db/migrate/20211022112858_devise_create_admin_users.rb
  8. 25
      db/seeds.rb

1
app/admin/admin_users.rb

@ -24,5 +24,4 @@ ActiveAdmin.register AdminUser do
end end
f.actions f.actions
end end
end end

2
app/admin/dashboard.rb

@ -28,5 +28,5 @@ ActiveAdmin.register_page "Dashboard" do
# end # end
# end # end
# end # end
end # content end
end end

2
app/admin/income_ranges.rb

@ -1,5 +1,4 @@
ActiveAdmin.register IncomeRange do ActiveAdmin.register IncomeRange do
# See permitted parameters documentation: # See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
# #
@ -14,5 +13,4 @@ ActiveAdmin.register IncomeRange do
# permitted << :other if params[:action] == 'create' && current_user.admin? # permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted # permitted
# end # end
end end

1
app/models/income_range.rb

@ -1,3 +1,2 @@
class IncomeRange < ApplicationRecord class IncomeRange < ApplicationRecord
end end

2
config/initializers/active_admin.rb

@ -157,7 +157,7 @@ ActiveAdmin.setup do |config|
# You can exclude possibly sensitive model attributes from being displayed, # You can exclude possibly sensitive model attributes from being displayed,
# added to forms, or exported by default by ActiveAdmin # added to forms, or exported by default by ActiveAdmin
# #
config.filter_attributes = [:encrypted_password, :password, :password_confirmation] config.filter_attributes = %i[encrypted_password password password_confirmation]
# == Localize Date/Time Format # == Localize Date/Time Format
# #

4
config/initializers/devise.rb

@ -24,7 +24,7 @@ Devise.setup do |config|
# Configure the e-mail address which will be shown in Devise::Mailer, # Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class # note that it will be overwritten if you use your own mailer class
# with default "from" parameter. # with default "from" parameter.
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
# Configure the class responsible to send e-mails. # Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer' # config.mailer = 'Devise::Mailer'
@ -36,7 +36,7 @@ Devise.setup do |config|
# Load and configure the ORM. Supports :active_record (default) and # Load and configure the ORM. Supports :active_record (default) and
# :mongoid (bson_ext recommended) by default. Other ORMs may be # :mongoid (bson_ext recommended) by default. Other ORMs may be
# available as additional gems. # available as additional gems.
require 'devise/orm/active_record' require "devise/orm/active_record"
# ==> Configuration for any authentication mechanism # ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is # Configure which keys are used when authenticating a user. The default is

1
db/migrate/20211022112858_devise_create_admin_users.rb

@ -32,7 +32,6 @@ class DeviseCreateAdminUsers < ActiveRecord::Migration[6.1]
# t.string :unlock_token # Only if unlock strategy is :email or :both # t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at # t.datetime :locked_at
t.timestamps null: false t.timestamps null: false
end end

25
db/seeds.rb

@ -5,21 +5,20 @@
# #
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first) # Character.create(name: 'Luke', movie: movies.first)
AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password') if Rails.env.development? AdminUser.create!(email: "admin@example.com", password: "password", password_confirmation: "password") if Rails.env.development?
income_ranges = [ income_ranges = [
{economic_status: "full_time", soft_min: 143, soft_max: 730, hard_min: 90, hard_max: 1230}, { economic_status: "full_time", soft_min: 143, soft_max: 730, hard_min: 90, hard_max: 1230 },
{economic_status: "part_time", soft_min: 67, soft_max: 620, hard_min: 50, hard_max: 950}, { economic_status: "part_time", soft_min: 67, soft_max: 620, hard_min: 50, hard_max: 950 },
{economic_status: "gov_training", soft_min: 80, soft_max: 480, hard_min: 40, hard_max: 990}, { economic_status: "gov_training", soft_min: 80, soft_max: 480, hard_min: 40, hard_max: 990 },
{economic_status: "job_seeker", soft_min: 50, soft_max: 370, hard_min: 10, hard_max: 450}, { economic_status: "job_seeker", soft_min: 50, soft_max: 370, hard_min: 10, hard_max: 450 },
{economic_status: "retired", soft_min: 50, soft_max: 380, hard_min: 10, hard_max: 690}, { economic_status: "retired", soft_min: 50, soft_max: 380, hard_min: 10, hard_max: 690 },
{economic_status: "not_seeking_work", soft_min: 53, soft_max: 540, hard_min: 10, hard_max: 890}, { economic_status: "not_seeking_work", soft_min: 53, soft_max: 540, hard_min: 10, hard_max: 890 },
{economic_status: "full_time_student", soft_min: 47, soft_max: 460, hard_min: 10, hard_max: 1300}, { economic_status: "full_time_student", soft_min: 47, soft_max: 460, hard_min: 10, hard_max: 1300 },
{economic_status: "unable_to_work", soft_min: 54, soft_max: 460, hard_min: 10, hard_max: 820}, { economic_status: "unable_to_work", soft_min: 54, soft_max: 460, hard_min: 10, hard_max: 820 },
{economic_status: "child_under_16", soft_min: 50, soft_max: 450, hard_min: 10, hard_max: 750}, { economic_status: "child_under_16", soft_min: 50, soft_max: 450, hard_min: 10, hard_max: 750 },
{economic_status: "other_adult", soft_min: 50, soft_max: 580, hard_min: 10, hard_max: 1040}, { economic_status: "other_adult", soft_min: 50, soft_max: 580, hard_min: 10, hard_max: 1040 },
{economic_status: "refused", soft_min: 47, soft_max: 730, hard_min: 10, hard_max: 1300} { economic_status: "refused", soft_min: 47, soft_max: 730, hard_min: 10, hard_max: 1300 },
] ]
income_ranges.each do |income_range| income_ranges.each do |income_range|

Loading…
Cancel
Save