Class: EmptyEye::ShardAssociationReflection

Inherits:
ActiveRecord::Reflection::AssociationReflection
  • Object
show all
Defined in:
lib/empty_eye/shard_association_reflection.rb

Instance Method Summary collapse

Instance Method Details

#association_classObject

special reflection for shard very verbose but will be easier to update later better than monkey patching



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/empty_eye/shard_association_reflection.rb', line 7

def association_class
  EmptyEye::Associations::ShardHasOneAssociation
  #later we will support all singular associations; for now only has one
  
  # case macro
  # when :belongs_to
  #   if options[:polymorphic]
  #     EmptyEye::Associations::ShardBelongsToPolymorphicAssociation
  #   else
  #     EmptyEye::Associations::ShardBelongsToAssociation
  #   end
  # when :has_one
  #   if options[:through]
  #     EmptyEye::Associations::ShardHasOneThroughAssociation
  #   else
  #     EmptyEye::Associations::ShardHasOneAssociation
  #   end
  # end
end