1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/lib/active_model
Yves Senn 7d196cf360 #to_param returns nil if to_key returns nil. Closes #11399.
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>'
```
2014-02-04 10:27:46 +01:00
..
locale Use :present as key for the absence validatior message 2012-12-21 17:10:16 -03:00
serializers Adding missing backslashes in active_model files so as to avoid unwanted links in rdoc [ci skip] 2013-12-27 13:58:31 +05:30
validations revises references to :allow_(nil|blank) in some docs [ci skip] [Steven Yang & Xavier Noria] 2014-01-26 20:50:18 +01:00
attribute_methods.rb Fix typo in AMo docs [ci skip] 2014-01-06 08:45:21 -02:00
callbacks.rb Fix few typos in the documentation [ci skip] 2013-12-21 18:59:55 +01:00
conversion.rb #to_param returns nil if to_key returns nil. Closes #11399. 2014-02-04 10:27:46 +01:00
dirty.rb Forgot to push this change in the parent commit 2014-01-20 23:00:17 -02:00
errors.rb Fix ActiveModel::Errors#has_key? return value 2014-01-22 21:01:41 +01:00
forbidden_attributes_protection.rb rm dead code 2012-11-09 10:31:23 +09:00
lint.rb Fix few typos and improve markup at some levels 2013-12-24 12:39:41 +01:00
model.rb Adding missing backslashes in active_model files so as to avoid unwanted links in rdoc [ci skip] 2013-12-27 13:58:31 +05:30
naming.rb Change syntax format for example returned values 2013-11-11 13:53:54 -05:00
railtie.rb Use BCrypt's MIN_COST in the test environment for speedier tests 2012-11-14 09:42:54 -06:00
secure_password.rb Some minor fixes 2014-01-24 20:06:31 -08:00
serialization.rb Fix few typos and improve markup at some levels 2013-12-24 12:39:41 +01:00
test_case.rb
translation.rb Convert ActiveModel to 1.9 hash syntax. 2013-05-01 18:01:46 -07:00
validations.rb Fix doc markup of clear_validators! 2014-01-27 08:26:54 -02:00
validator.rb Merge branch 'master' of github.com:lifo/docrails 2013-12-20 00:10:30 +05:30
version.rb Get ready to release 4.1.0.beta1 2013-12-17 16:05:28 -08:00