Skip to content

Commit

Permalink
change to use Time.zone for rubocop-rails Rails/TimeZone (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
eitoball authored Oct 9, 2022
1 parent 51583a7 commit 3bc6525
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
10 changes: 0 additions & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,6 @@ Rails/SquishedSQLHeredocs:
- app/controllers/measurements_controller.rb
- db/migrate/20160208190731_add_subtype_to_measurement_imports.rb
- db/migrate/20160607005457_alter_measurement_imports_subtype_set_not_null.rb
Rails/TimeZone:
Exclude:
- db/migrate/20130606042505_add_devise_confirmable_to_user.rb
- lib/tasks/boostrap.rake
- spec/acceptance/guest_signs_up_spec.rb
- spec/fabricators/user_fabricator.rb
Rails/UniqueValidationWithoutIndex:
Exclude:
- app/models/device.rb
- app/models/device_story.rb

RSpec/BeforeAfterAll:
Exclude:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def up

add_index :users, :confirmation_token

User.update_all confirmed_at: Time.now
User.update_all confirmed_at: Time.zone.now
end

def down
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/boostrap.rake
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ namespace :db do
password_confirmation: '111111'
)
u.moderator = true
u.confirmed_at = Time.now
u.confirmed_at = Time.zone.now
u.save
puts "Created user #{u.email} with password #{u.password}"
attrs = {
name: 'Fake User',
password: '111111',
password_confirmation: '111111',
moderator: false,
confirmed_at: Time.now
confirmed_at: Time.zone.now
}
%w([email protected] [email protected]).each do |email|
u = User.create!(attrs.merge(email: email))
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/guest_signs_up_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
scenario 'signing up' do
sign_up
new_user = User.last
new_user.confirmed_at = Time.now
new_user.confirmed_at = Time.zone.now
new_user.save
new_user.password = 'mynewpassword'
sign_in(new_user)
Expand Down
4 changes: 2 additions & 2 deletions spec/fabricators/user_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
email { "paul#{Fabricate.sequence(:email)}@rslw.com" }
password 'monkeys'
default_locale 'en-US'
confirmed_at Time.now
confirmed_at Time.zone.now
end

Fabricator(:admin_user, from: :user) do
name 'Admin'
email '[email protected]'
password '111111'
confirmed_at Time.current
confirmed_at Time.zone.now
default_locale 'en-US'
moderator true
end

0 comments on commit 3bc6525

Please sign in to comment.