Skip to content

Instantly share code, notes, and snippets.

@RichGuk
Created May 13, 2014 08:52
Show Gist options
  • Save RichGuk/3d1d6e2e923ebc2977b0 to your computer and use it in GitHub Desktop.
Save RichGuk/3d1d6e2e923ebc2977b0 to your computer and use it in GitHub Desktop.
class SanitisedString < Virtus::Attribute::Object
primitive String
def coerce(value)
value.to_s.strip
end
end
attribute :email, SanitisedString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment