Skip to content

Instantly share code, notes, and snippets.

@myobie
Created July 17, 2009 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myobie/149155 to your computer and use it in GitHub Desktop.
Save myobie/149155 to your computer and use it in GitHub Desktop.
+++ my-dm-validations.rb
--- dm-validations.rb
@@ -87,7 +87,6 @@
# Check if a resource is valid in a given context
#
def valid?(context = :default)
+ return true if respond_to?(:model) && !self.new? && !self.dirty?
klass = respond_to?(:model) ? model : self.class
klass.validators.execute(context, self)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment