forked from bofh/fetsite
design und struktur (container - unnötige entfernt)
This commit is contained in:
@@ -14,6 +14,7 @@ class Calendar < ActiveRecord::Base
|
||||
attr_accessible :name, :public, :picture
|
||||
has_and_belongs_to_many :calentries
|
||||
mount_uploader :picture, PictureUploader
|
||||
belongs_to :rubrik
|
||||
resourcify
|
||||
scope :public, -> { where(:public => :true) }
|
||||
end
|
||||
|
||||
@@ -15,12 +15,13 @@ class Rubrik < ActiveRecord::Base
|
||||
has_many :neuigkeiten, :class_name => "Neuigkeit"
|
||||
has_many :calentries, :through => :neuigkeiten, :as=>:object
|
||||
resourcify
|
||||
def moderator
|
||||
u=User.with_role(:newsmoderator).first
|
||||
if !u.nil?
|
||||
u.id
|
||||
end
|
||||
end
|
||||
has_one :calendar
|
||||
def moderator
|
||||
u=User.with_role(:newsmoderator).first
|
||||
if !u.nil?
|
||||
u.id
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user