Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Created June 28, 2019 23:09
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 lukaszkorecki/2422b18d9c73235ef487f4c9a5a581a1 to your computer and use it in GitHub Desktop.
Save lukaszkorecki/2422b18d9c73235ef487f4c9a5a581a1 to your computer and use it in GitHub Desktop.
class SomeDataThing < OpenStruct
include ActiveModel::Validations
validates :name, presence: true
validates :email, presence: true
end
SomeDataThing.new(name: "I'm tired").valid? # => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment