Permalink
Browse files

Remove validation of option keys for save.

  • Loading branch information...
1 parent c0d9d8e commit 9294f4b7eb4e51e2cf5a7bdcbb79097314dc0c55 @jnunemaker committed Nov 16, 2012
Showing with 1 addition and 8 deletions.
  1. +0 −1 lib/toy/validations.rb
  2. +1 −7 spec/toy/validations_spec.rb
View
@@ -19,7 +19,6 @@ def valid?
end
def save(options={})
- options.assert_valid_keys(:validate)
!options.fetch(:validate, true) || valid? ? super : false
end
@@ -82,12 +82,6 @@ def name_not_john
end
end
- context "with invalid option" do
- it "raises error" do
- lambda { User.new.save(:foobar => '') }.should raise_error
- end
- end
-
context "with :validate option" do
before do
User.validates_presence_of(:name)
@@ -147,4 +141,4 @@ def name_not_john
end
end
end
-end
+end

0 comments on commit 9294f4b

Please sign in to comment.