Skip to content

Instantly share code, notes, and snippets.

@michael-gabenna
Forked from ibrahimab/gist:3d74d4bae246870a74c5
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save michael-gabenna/abcbf21172ca9c7d2ba0 to your computer and use it in GitHub Desktop.

Select an option

Save michael-gabenna/abcbf21172ca9c7d2ba0 to your computer and use it in GitHub Desktop.
class TypeValidator < ActiveModel::Validator
def validate(record)
#validation
end
end
class MyModel
include ActiveModel::Model
validates_with TypeValidator
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment