rails/activemodel/CHANGELOG.md
Akira Matsuda d10d5aedce
TZ offset minute has to be negated in the Western Hemisphere
When the TZ in the given string contains minus offset, both hour and minute
value has to be negated, but the current code negates hour only.
Hence, for instance in Newfoundland Time Zone (UTC−03:30), it used to return
1 hour advanced value.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-01-17 17:25:37 +09:00

745 B

  • Fix a bug where type casting of string to Time and DateTime doesn't calculate minus minute value in TZ offset correctly.

    Akira Matsuda

  • Port the type_for_attribute method to Active Model. Classes that include ActiveModel::Attributes will now provide this method. This method behaves the same for Active Model as it does for Active Record.

    class MyModel
      include ActiveModel::Attributes
    
      attribute :my_attribute, :integer
    end
    
    MyModel.type_for_attribute(:my_attribute) # => #<ActiveModel::Type::Integer ...>
    

    Jonathan Hefner

Please check 7-1-stable for previous changes.