User:

class User < Sequel::Model
many_to_many :documents
self.raise_on_save_failure = false
plugin :validation_helpers
def validate
super
validates_format /@/, :email
validates_presence [:password]
validates_unique :email
end

def before_save
super
self[:password] = BCrypt::Password.create(self[:password])
end
end

Update:

def updateUser(userData)
user = User.where(id: userData[:id]).update(
email: userData[:email]

)
end

Works with userData[:email] => '1111', but should not (doesn't has '@')

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to