outdate topics after 7 months

This commit is contained in:
Andreas Stephanides
2015-02-09 15:38:38 +01:00
parent f1a149908d
commit ebf486b347

View File

@@ -31,12 +31,12 @@ include Rails.application.routes.url_helpers
text :text
text :title, :boost=>4.0
end
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",2.month.ago).where("thema_translations.locale"=>I18n.t.locale)
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",7.month.ago).where("thema_translations.locale"=>I18n.t.locale)
}
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
def is_outdated?
unless translation.try(:updated_at).nil?
translation.updated_at < 2.month.ago
translation.updated_at < 7.month.ago
else
false
end