Beispiele hinzugefügt

This commit is contained in:
Andreas Stephanides
2013-02-15 10:48:52 +01:00
parent 154e338360
commit 19b4ed31f4
23 changed files with 305 additions and 19 deletions

7
app/models/beispiel.rb Normal file
View File

@@ -0,0 +1,7 @@
class Beispiel < ActiveRecord::Base
has_paper_trail
attr_accessible :desc, :name, :file, :lva_id
has_attached_file :file
belongs_to :lva
translates :desc, :fallbacks_for_empty_translations => true
end

View File

@@ -4,4 +4,5 @@ class Lva < ActiveRecord::Base
has_and_belongs_to_many :modul
has_and_belongs_to_many :semester
translates :desc, :fallbacks_for_empty_translations => true
has_many :beispiele , :class_name => "Beispiel"
end

View File

@@ -9,7 +9,5 @@ def moderator
end
end
def moderator=(id)
User.find(id).add_role(:newsmoderator, self)
end
end