aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/conversion_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "No such class since 8d2866bb80fbe81acb04f5b0c44f152f571fb29f"Rafael Mendonça França2019-08-021-1/+1
| | | | This reverts commit dd779c9686f49f5ed6dda8ad5a1cb3b0788e1dd4.
* No such class since 8d2866bb80fbe81acb04f5b0c44f152f571fb29fAkira Matsuda2019-08-021-1/+1
|
* Use frozen string literal in activemodel/Kir Shatrov2017-07-161-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* applies new string literal convention in activemodel/testXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* [ci skip] add tests for ActionModel::ConversionAditya Kapoor2014-06-111-0/+4
|
* `#to_param` returns `nil` if `to_key` returns `nil`. Closes #11399.Yves Senn2014-02-041-0/+10
| | | | | | | | | | | | | | | | 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>' ```
* Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-011-2/+2
| | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
* test for ActiveModel::Conversion#to_partial_path and namespaced modelsYves Senn2013-01-141-0/+4
|
* Fix comments about to_partial_pathGrant Hutchins2012-03-101-1/+1
|
* Rename new method to_path to to_partial_path to avoid conflicts with ↵José Valim2011-08-011-3/+3
| | | | File#to_path and similar.
* Let ActiveModel instances define partial paths.Grant Hutchins & Peter Jaros2011-07-251-1/+8
| | | | | | Deprecate ActiveModel::Name#partial_path. Now you should call #to_path directly on ActiveModel instances.
* Require persisted? in ActiveModel::Lint and remove new_record? and ↵José Valim2010-02-211-2/+2
| | | | destroyed? methods. ActionPack does not care if the resource is new or if it was destroyed, it cares only if it's persisted somewhere or not.
* Add to_key and to_param methods to ActiveModel::Conversion.José Valim2010-02-211-0/+25