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>' ``` |
||
---|---|---|
.. | ||
serializers | ||
validations | ||
attribute_methods_test.rb | ||
callbacks_test.rb | ||
conversion_test.rb | ||
dirty_test.rb | ||
errors_test.rb | ||
forbidden_attributes_protection_test.rb | ||
helper.rb | ||
lint_test.rb | ||
model_test.rb | ||
naming_test.rb | ||
railtie_test.rb | ||
secure_password_test.rb | ||
serialization_test.rb | ||
translation_test.rb | ||
validations_test.rb |