mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
7d196cf360
The documentation of `#to_key` (http://api.rubyonrails.org/classes/ActiveModel/Conversion.html#method-i-to_key) states that it returns `nil` if there are no key attributes. `to_param` needs to be aware of that fact and return `nil` as well. Previously it raised the following exception: ``` 1) Error: ConversionTest#test_to_param_returns_nil_if_to_key_is_nil: NoMethodError: undefined method `join' for nil:NilClass /Users/senny/Projects/rails/activemodel/lib/active_model/conversion.rb:65:in `to_param' /Users/senny/Projects/rails/activemodel/test/cases/conversion_test.rb:34:in `block in <class:ConversionTest>' ``` |
||
---|---|---|
.. | ||
locale | ||
serializers | ||
validations | ||
attribute_methods.rb | ||
callbacks.rb | ||
conversion.rb | ||
dirty.rb | ||
errors.rb | ||
forbidden_attributes_protection.rb | ||
lint.rb | ||
model.rb | ||
naming.rb | ||
railtie.rb | ||
secure_password.rb | ||
serialization.rb | ||
test_case.rb | ||
translation.rb | ||
validations.rb | ||
validator.rb | ||
version.rb |