Sha256: f5b5724d45bae880f7421e21f991acfbadfaf09bc4e3254d1a001eb3e7a5dd5b
Contents?: true
Size: 588 Bytes
Versions: 1
Compression:
Stored size: 588 Bytes
Contents
module Merit class BadgesSash < ActiveRecord::Base belongs_to :sash has_many :activity_logs, class_name: Merit::ActivityLog, as: :related_change if defined?(ProtectedAttributes) || !defined?(ActionController::StrongParameters) attr_accessible :badge_id end def self.last_granted(options = {}) options[:since_date] ||= 1.month.ago options[:limit] ||= 10 where("created_at > '#{options[:since_date]}'"). limit(options[:limit]). map(&:badge) end def badge Badge.find(badge_id) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
merit-1.7.1 | lib/merit/models/active_record/merit/badges_sash.rb |