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.



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

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.



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

def foreign_geom
  @foreign_geom
end

#geomObject (readonly)

Returns the value of attribute geom.



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

def geom
  @geom
end

#relationshipObject (readonly)

Returns the value of attribute relationship.



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

def relationship
  @relationship
end

#scope_optionsObject (readonly)

Returns the value of attribute scope_options.



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

def scope_options
  @scope_options
end

Instance Method Details

#association_classObject



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

def association_class
  Associations::SpatialAssociation
end