Sha256: dafbd766de50d6cbf0ab68b40b884b48c76cd84a477b2553103b35a0f4706caa
Contents?: true
Size: 667 Bytes
Versions: 14
Compression:
Stored size: 667 Bytes
Contents
### QALAM_MERIT ### class Merit::QalamBadgeSash < ActiveRecord::Base self.table_name = "badges_sashes" belongs_to :badge, foreign_key: "badge_id", class_name: 'Merit::Badge' belongs_to :sash, foreign_key: "sash_id", class_name: 'Merit::QalamSash' # has_many :users, through: :sash, source: :users class << self def user(badge_sash_id = nil) return [] unless badge_sash_id return [] unless badge_sash = Merit::QalamBBadgeSash.find(badge_sash_id) sash = badge_sash.sash return [] unless sash && sash.id && sash_id = sash.id User.where(sash_id: sash_id) end end end
Version data entries
14 entries across 14 versions & 1 rubygems