Class: EmptyEye::Associations::ShardHasOneAssociation

Inherits:
ActiveRecord::Associations::HasOneAssociation
  • Object
show all
Defined in:
lib/empty_eye/associations/shard_has_one_association.rb

Instance Method Summary collapse

Instance Method Details

#association_scopeObject

special association for shard very verbose but will be easier to update later better than monkey patching here we are patching the need to set the polymorphic type for a association the shard is the ‘owner’ but we want the type to be the master class



10
11
12
13
14
# File 'lib/empty_eye/associations/shard_has_one_association.rb', line 10

def association_scope
  if klass
    @association_scope ||= ShardAssociationScope.new(self).scope
  end
end