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.5.2 spec/dummy/app/models/appendage.rb
switchman-1.5.1 spec/dummy/app/models/appendage.rb
switchman-1.5.0 spec/dummy/app/models/appendage.rb
switchman-1.4.4 spec/dummy/app/models/appendage.rb
switchman-1.4.3 spec/dummy/app/models/appendage.rb
switchman-1.4.2 spec/dummy/app/models/appendage.rb
switchman-1.4.1 spec/dummy/app/models/appendage.rb
switchman-1.4.0 spec/dummy/app/models/appendage.rb
switchman-1.3.18 spec/dummy/app/models/appendage.rb
switchman-1.3.17 spec/dummy/app/models/appendage.rb
switchman-1.3.14.pre.1 spec/dummy/app/models/appendage.rb
switchman-1.3.13.pre.1 spec/dummy/app/models/appendage.rb
switchman-1.3.16 spec/dummy/app/models/appendage.rb
switchman-1.3.15 spec/dummy/app/models/appendage.rb
switchman-1.3.14 spec/dummy/app/models/appendage.rb
switchman-1.3.13 spec/dummy/app/models/appendage.rb
switchman-1.3.12 spec/dummy/app/models/appendage.rb
switchman-1.3.11 spec/dummy/app/models/appendage.rb
switchman-1.3.10 spec/dummy/app/models/appendage.rb
switchman-1.3.9 spec/dummy/app/models/appendage.rb