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.10 spec/dummy/app/models/appendage.rb
switchman-1.2.9 spec/dummy/app/models/appendage.rb
switchman-1.2.8 spec/dummy/app/models/appendage.rb
switchman-1.2.7 spec/dummy/app/models/appendage.rb
switchman-1.2.5 spec/dummy/app/models/appendage.rb
switchman-1.2.4 spec/dummy/app/models/appendage.rb
switchman-1.2.3 spec/dummy/app/models/appendage.rb
switchman-1.2.2 spec/dummy/app/models/appendage.rb
switchman-1.2.1 spec/dummy/app/models/appendage.rb
switchman-1.2.0 spec/dummy/app/models/appendage.rb