forked from bofh/fetsite
Views & Logik Membership, Fetprofile, Gremium
This commit is contained in:
@@ -23,5 +23,8 @@ class Fetprofile < ActiveRecord::Base
|
||||
[vorname, nachname, "(",short,")"].join(" ")
|
||||
end
|
||||
accepts_nested_attributes_for :memberships
|
||||
scope :active, -> { where(:active=>:true).order(:vorname) }
|
||||
scope :active, -> { where(:active=>true).order(:vorname) }
|
||||
def fetmail
|
||||
fetmailalias.empty? ? short + "@fet.at" : fetmailalias + "@fet.at"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,4 +17,6 @@ class Membership < ActiveRecord::Base
|
||||
attr_accessible :fetprofile_id, :gremium_id, :start, :stop, :typ
|
||||
belongs_to :fetprofile
|
||||
belongs_to :gremium
|
||||
scope :active, -> {where("stop >= ? OR stop IS NULL", Time.now.to_date)}
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user