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

Version Path
qalam_merit-4.5.12 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.11 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.10 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.09 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.08 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.07 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.06 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.05 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.04 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.03 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.02 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.01 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.5.00 lib/merit/generators/templates/qalam_badge_sash.erb
qalam_merit-4.0.4 lib/merit/generators/templates/qalam_badge_sash.erb