Skip to content

Instantly share code, notes, and snippets.

@collin
Created November 21, 2008 18:23
Show Gist options
  • Select an option

  • Save collin/27535 to your computer and use it in GitHub Desktop.

Select an option

Save collin/27535 to your computer and use it in GitHub Desktop.
class DataMapper::Validate::ValidationErrors
def to_h
@errors || {}
end
def merge some_errors
to_h.merge! some_errors.to_h
end
end
# meta is the joined model
def validate_meta
self.errors.merge(meta.errors) unless meta.valid?
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment