Skip to content

Commit

Permalink
Merge pull request #124 from jrafanie/avoid_rails7_deprecation_ar_bas…
Browse files Browse the repository at this point in the history
…e_default_timezone

Fix rails 7 deprecation on ActiveRecord::Base.default_timezone
  • Loading branch information
agrare committed Mar 7, 2024
2 parents 0667ba7 + 8e374a3 commit 46e5701
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/inventory_refresh/save_collection/saver/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,8 @@ def assert_referential_integrity(hash)
true
end

# @return [Time] A rails friendly time getting config from ActiveRecord::Base.default_timezone (can be :local
# or :utc)
def time_now
if ActiveRecord::Base.default_timezone == :utc
Time.now.utc
else
Time.zone.now
end
Time.current
end

# Enriches data hash with timestamp columns
Expand Down

0 comments on commit 46e5701

Please sign in to comment.