Sha256: 7944a06ba41e2c9e63316a6d56653d00e3953a5f1bd566265dc675c9e6eebad9

Contents?: true

Size: 578 Bytes

Versions: 70

Compression:

Stored size: 578 Bytes

Contents

class Appendage < ActiveRecord::Base
  belongs_to :user
  has_many :digits

  has_many :features, :as => :owner

  scope :has_no_value, -> { where(:value => nil) }
  scope :has_value, -> { where("appendages.value IS NOT NULL") }

  attr_writer :associated_shards
  class << self
    attr_accessor :associated_shards_map
  end

  def self.associated_shards_for(global_id)
    associated_shards_map[global_id] if global_id && associated_shards_map
  end

  def associated_shards
    self.class.associated_shards_for(self.global_id) || @associated_shards || [self.shard]
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
switchman-1.2.30 spec/dummy/app/models/appendage.rb
switchman-1.2.29 spec/dummy/app/models/appendage.rb
switchman-1.2.28 spec/dummy/app/models/appendage.rb
switchman-1.2.27 spec/dummy/app/models/appendage.rb
switchman-1.2.26 spec/dummy/app/models/appendage.rb
switchman-1.2.25 spec/dummy/app/models/appendage.rb
switchman-1.2.24 spec/dummy/app/models/appendage.rb
switchman-1.2.23 spec/dummy/app/models/appendage.rb
switchman-1.2.22 spec/dummy/app/models/appendage.rb
switchman-1.2.21 spec/dummy/app/models/appendage.rb
switchman-1.2.20 spec/dummy/app/models/appendage.rb
switchman-1.2.19 spec/dummy/app/models/appendage.rb
switchman-1.2.18 spec/dummy/app/models/appendage.rb
switchman-1.2.17 spec/dummy/app/models/appendage.rb
switchman-1.2.16 spec/dummy/app/models/appendage.rb
switchman-1.2.15 spec/dummy/app/models/appendage.rb
switchman-1.2.14 spec/dummy/app/models/appendage.rb
switchman-1.2.13 spec/dummy/app/models/appendage.rb
switchman-1.2.12 spec/dummy/app/models/appendage.rb
switchman-1.2.11 spec/dummy/app/models/appendage.rb