ncbo / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
15 stars 6 forks source link

Create email validator #59

Closed msalvadores closed 11 years ago

msalvadores commented 11 years ago

Add a custom validator for email addresses. This is needed on User, possibly elsewhere.

msalvadores commented 11 years ago

@palexander @darrenleeweber @mdorf

New email validator in goo. Use with attribute :attr_name, :email => true

class Person < Goo::Base::Resource
  attribute :attr_name, :email => true

  def initialize(attributes = {})
    super(attributes)
  end
end

If the attribute name is :email that's fine there is no conflict.