Files
fetsite/app/models/rubrik.rb
2013-10-04 16:11:36 +02:00

28 lines
597 B
Ruby
Executable File

# == Schema Information
#
# Table name: rubriken
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# prio :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Rubrik < ActiveRecord::Base
attr_accessible :desc, :name, :prio, :calendar
has_many :neuigkeiten, :class_name => "Neuigkeit"
has_many :calentries, :through => :neuigkeiten, :as=>:object
resourcify
has_one :calendar
def moderator
u=User.with_role(:newsmoderator).first
if !u.nil?
u.id
end
end
end