diff --git a/app/models/lva.rb b/app/models/lva.rb index 4c80b04..dcd7e17 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -40,7 +40,7 @@ class Lva < ActiveRecord::Base has_paper_trail :ignore=>[:desc, :pruefungsinformation]# Versionsverfolgung translates :desc,:pruefungsinformation, :fallbacks_for_empty_translations => true, :versioning=>true - attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ, :lecturer_ids + attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ, :lecturer_ids, :forumlink has_and_belongs_to_many :modul,:uniq=>true # Gehört zu einem Modul has_and_belongs_to_many :semester diff --git a/app/models/thema.rb b/app/models/thema.rb index 5d98ce0..2bfdeaf 100644 --- a/app/models/thema.rb +++ b/app/models/thema.rb @@ -23,10 +23,11 @@ include Rails.application.routes.url_helpers validates :text, :presence => true scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")} - scope :outdated, -> {where("updated_at < ?", 2.month.ago)} + scope :outdated, -> {includes(:translations).where("thema_translations.updated_at",2.month.ago).where("thema_translations.locale"=>I18n.t.locale) +} translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true def is_outdated? - updated_at < 1.month.ago + translation.updated_at < 2.month.ago end def is_wiki? !(wikiname.nil? || wikiname.empty?) diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index fce1d78..3aee19d 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -20,15 +20,20 @@ <%= f.input :ects, :wrapper_html=>{:class=>'span4'} %> <%= f.input :stunden, :wrapper_html=>{:class=>'span4'} %> + +