Skip to content

Commit

Permalink
Removed unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 26, 2024
1 parent 45174f4 commit 78fd453
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/lockbox/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -596,15 +596,13 @@ def reload
case options[:type]
when :boolean
message = ActiveRecord::Type::Boolean.new.serialize(message)
message = nil if message == "" # for Active Record < 5.2
message = message ? "t" : "f" unless message.nil?
when :date
message = ActiveRecord::Type::Date.new.serialize(message)
# strftime should be more stable than to_s(:db)
message = message.strftime("%Y-%m-%d") unless message.nil?
when :datetime
message = ActiveRecord::Type::DateTime.new.serialize(message)
message = nil unless message.respond_to?(:iso8601) # for Active Record < 5.2
message = message.iso8601(9) unless message.nil?
when :time
message = ActiveRecord::Type::Time.new.serialize(message)
Expand Down

0 comments on commit 78fd453

Please sign in to comment.