Class: ActiveRecord::Reflection::SpatialReflection

Inherits:
SPATIAL_REFLECTION_BASE_CLASS
  • Object
show all
Defined in:
lib/activerecord-spatial/associations/reflection/spatial_reflection.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ SpatialReflection

Returns a new instance of SpatialReflection.



16
17
18
19
20
21
22
23
# File 'lib/activerecord-spatial/associations/reflection/spatial_reflection.rb', line 16

def initialize(*args)
  super(*args.from(1))

  @geom = options[:geom]
  @foreign_geom = options[:foreign_geom]
  @relationship = options[:relationship].to_s
  @scope_options = (options[:scope_options] || {}).merge(column: foreign_geom)
end

Instance Attribute Details

#foreign_geomObject (readonly)

Returns the value of attribute foreign_geom.



14
15
16
# File 'lib/activerecord-spatial/associations/reflection/spatial_reflection.rb', line 14

def foreign_geom
  @foreign_geom
end

#geomObject (readonly)

Returns the value of attribute geom.



14
15
16
# File 'lib/activerecord-spatial/associations/reflection/spatial_reflection.rb', line 14

def geom
  @geom
end

#relationshipObject (readonly)

Returns the value of attribute relationship.



14
15
16
# File 'lib/activerecord-spatial/associations/reflection/spatial_reflection.rb', line 14

def relationship
  @relationship
end

#scope_optionsObject (readonly)

Returns the value of attribute scope_options.



14
15
16
# File 'lib/activerecord-spatial/associations/reflection/spatial_reflection.rb', line 14

def scope_options
  @scope_options
end

Instance Method Details

#association_classObject



25
26
27
# File 'lib/activerecord-spatial/associations/reflection/spatial_reflection.rb', line 25

def association_class
  Associations::SpatialAssociation
end