Model Missing Attributes, SQLite Immediate Transactions, and CVV/CVC Parameter Filtering by default
Hi, it’s zzak. This is a short week, but let’s jump in.
Drop Hash#except core extension
Rails 8.0 will be Ruby 3.1 or greater only except
natively got added in Ruby 3.0 so this is dead code now.
Introduce ActiveModel::AttributeAssignment#attribute_writer_missing
Provide instances with an opportunity to gracefully handle assigning to an unknown attribute:
class Rectangle
include ActiveModel::AttributeAssignment
attr_accessor :length, :width
def attribute_writer_missing(name, value)
Rails.logger.warn "Tried to assign to unknown attribute #{name}"
end
end
rectangle = Rectangle.new
rectangle.assign_attributes(height: 10)
# => Logs "Tried to assign to unknown attribute…
Add “cvv” and “cvc” as default parameters to filter out in new apps
For new apps, this PR adds cvv
and cvc
to the defaults for ActiveSupport::ParameterFilter.
Ensure SQLite transaction default to IMMEDIATE mode
This PR updates the SQLite…