diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-02 23:56:12 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-02 23:57:00 -0300 |
commit | 86062005a73589dc4919cfac401ce061f061c6a0 (patch) | |
tree | e12b9e1621ef050d069c77937051ee51d9fa0ff8 /activemodel/test | |
parent | 454d820bf0a18fe1db4c55b0145197d70fef1f82 (diff) | |
download | rails-86062005a73589dc4919cfac401ce061f061c6a0.tar.gz rails-86062005a73589dc4919cfac401ce061f061c6a0.tar.bz2 rails-86062005a73589dc4919cfac401ce061f061c6a0.zip |
Revert "Merge pull request #7826 from sikachu/master-validators-kind"
This reverts commit 4e9f53f9736544f070e75e516c71137b7eb49a7a, reversing
changes made to 6b802cdb4f5b84e1bf49aaeb0e994b3be6028af9.
Revert "Don't use tap in this case."
This reverts commit 454d820bf0a18fe1db4c55b0145197d70fef1f82.
Reason: Is not a good idea to add options to this method since we can do
the same thing using method composition.
Person.validators_on(:name).select { |v| v.kind == :presence }
Also it avoids to change the method again to add more options.
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/validations_test.rb | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/activemodel/test/cases/validations_test.rb b/activemodel/test/cases/validations_test.rb index 66d9e51854..a9d32808da 100644 --- a/activemodel/test/cases/validations_test.rb +++ b/activemodel/test/cases/validations_test.rb @@ -287,14 +287,6 @@ class ValidationsTest < ActiveModel::TestCase assert_equal [], Topic.validators_on(:author_name) end - def test_list_of_validators_on_an_attribute_based_on_kind - Topic.validates_presence_of :title, :content - Topic.validates_length_of :title, :minimum => 2 - - assert_equal Topic.validators_on(:title).select { |v| v.kind == :presence }, - Topic.validators_on(:title, kind: :presence) - end - def test_validations_on_the_instance_level auto = Automobile.new |