Created
March 9, 2015 02:50
-
-
Save leadhkr/5c25d6a951233b48a71b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Group | |
include DataMapper::Resource | |
property :id, Serial | |
property :group_name, String, { :required => true, | |
:unique => true, | |
:messages => { :is_unique => "League name is taken. Please choose another." } | |
} | |
property :password, BCryptHash, :required => true | |
validates_confirmation_of :password | |
attr_accessor :password_confirmation | |
validates_length_of :password_confirmation, :min => 6, if: :new_group | |
def new_group | |
self.new? || self.dirty? | |
end | |
has n, :users | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment