outdate topics after 7 months
This commit is contained in:
@@ -31,12 +31,12 @@ include Rails.application.routes.url_helpers
|
|||||||
text :text
|
text :text
|
||||||
text :title, :boost=>4.0
|
text :title, :boost=>4.0
|
||||||
end
|
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
|
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||||
def is_outdated?
|
def is_outdated?
|
||||||
unless translation.try(:updated_at).nil?
|
unless translation.try(:updated_at).nil?
|
||||||
translation.updated_at < 2.month.ago
|
translation.updated_at < 7.month.ago
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user