Skip to content

Instantly share code, notes, and snippets.

@trek
Created May 25, 2013 22:22
Show Gist options
  • Save trek/5650970 to your computer and use it in GitHub Desktop.
Save trek/5650970 to your computer and use it in GitHub Desktop.
Class.new(Parameters, &@block).new(value).tap do |p|
unless p.valid?
record.errors.add(attribute, :invalid, options.merge(:value => value))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment