Created
June 4, 2010 03:02
-
-
Save zombor/424874 to your computer and use it in GitHub Desktop.
This file contains 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
module Picombo | |
module Models | |
class User < Picombo::Model | |
storage_names[:default] = 'users' | |
property :id, Serial, :key => true | |
property :email, String | |
property :password, String | |
property :first_name, String | |
property :last_name, String | |
property :last_login, Integer | |
property :logins, Integer | |
property :activation_code, String | |
property :rating, Integer | |
property :funds, Float | |
property :has_bonus, Boolean | |
property :address, Text | |
has n, :roles, :through => Resource | |
has n, :tournaments, :through => Resource | |
has n, :wall_posts, :model => Picombo::Models::Wall_Post | |
has n, :ratings, :model => Picombo::Models::User_Rating, :order => [ :date.desc ] | |
def password=(new_password) | |
attribute_set(:password, Picombo::Auth.hash_password(new_password)) | |
end | |
def self.name_field | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment