Sha256: d3c8ccaad1f4115846bf33db5e0777a87f0554b591638479eb8899471d22d109
Contents?: true
Size: 539 Bytes
Versions: 1
Compression:
Stored size: 539 Bytes
Contents
module Merit class BadgesSash include Mongoid::Document include Mongoid::Timestamps include Base::BadgesSash field :badge_id, type: Integer belongs_to :sash, class_name: 'Merit::Sash' has_many :activity_logs, class_name: 'Merit::ActivityLog', as: :related_change def self.last_granted(options = {}) options[:since_date] ||= 1.month.ago options[:limit] ||= 10 where(:created_at.lte => options[:since_date]) .limit(options[:limit]) .map(&:badge) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
merit-3.0.3 | lib/merit/models/mongoid/merit/badges_sash.rb |