app/models/concept/skos/base.rb in iqvoc-4.12.1 vs app/models/concept/skos/base.rb in iqvoc-4.13.0
- old
+ new
@@ -38,6 +38,16 @@
def self.not_expired(time = Time.now)
col = arel_table[:expired_at]
where((col.eq(nil)).or(col.gteq(time)))
end
+
+ def self.recent(limit = 5)
+ self
+ .published
+ .not_expired
+ .joins(:notes => :annotations)
+ .where(note_annotations: { predicate: 'created' })
+ .order('note_annotations.value DESC')
+ .limit(limit)
+ end
end