- Fix an incompatibility with the Rails main branch.
- Drop upper limit on ActionPack, test with Rails main.
- use match? instead of =~ in HexConstraint
- Adds a ULID constraint type
- Error string correction in Datetime constraint
- Adds support for date, date_iso8601, time, and time_iso8601 constraints
- Changes ActiveSupport::Notifications.publish -> ActiveSupport::Notifications.instrument
- CI automations
- Support for rails in API-only mode
- Drop ruby 2.5 and 2.6 support
- Add ruby 3.0 and 3.1 support
- Add rails 7.0 support
- rails 7 support
- rails 4 removed
- Allow boolean string values of any casing (eg "TRUE")
- Allow strings of numbers with whitespace (eg " 123")
- rails 6.1 support
- drop rails 3 support
- drop ruby 2.4 support
- allow parameters to be marked as required (refs GH#72)
- Controller support (PermittedParameters)
- rails 5.0 support
- fix type, null_string => nil_string
- allow the value "on" to be considered boolean
- support string minimum_size
- no longer raises
StrongerParameters::InvalidParameter
inside of constraints: make your custom constraints return StrongerParameters::InvalidValue
instead
- added new
Parameters.nil
- added new
Parameters.float
- added new
Parameters.regexp
- added new
Parameters.nil_string
- added new unsigned
Parameters.ubigid
and Parameters.uid
- WARNING: no longer accepts
nil
for all parameters, use | Parameters.nil
, for transition period you can use this to log all calls that would result in StrongerParameters::InvalidParameter
, alternatively keep nils and use ActionController::Parameters.allow_nil_for_everything = true
action_on_invalid_parameters
will now raise by default
action_on_invalid_parameters
is now set on ActionController::Parameters
# tested in test/unit/zendesk/extensions/strong_parameters_test.rb
# remove once we no longer see log messages in production
ActionController::Parameters.action_on_invalid_parameters = lambda do |result, key|
if result.value.nil? && Rails.env.production?
Rails.logger.error("Previously allowed nil value passed #{key} -- #{result.message}")
else
# default action
raise StrongerParameters::InvalidParameter.new(result, key)
end
end