1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 16:53:23 -05:00

Make it possible to limit roles by date

This commit is contained in:
Jason Denney 2013-04-25 21:38:55 -04:00
parent 6f6902dd82
commit a614b28558
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ class User < ActiveRecord::Base
has_many :user_profiles
accepts_nested_attributes_for :user_profiles, allow_destroy: false
has_many :user_role_joins
has_many :user_role_joins, :conditions => ["ends IS NULL OR ends > ?", Time.now]
has_many :roles, through: :user_role_joins
belongs_to :bike

View File

@ -1,6 +1,6 @@
class UserRoleJoin < ActiveRecord::Base
set_table_name :user_role_joins
attr_accessible :role_id, :user_id
attr_accessible :role_id, :user_id, :ends
belongs_to :user
belongs_to :role