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:
parent
6f6902dd82
commit
a614b28558
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user