Module: RGeo::ActiveRecord::GeoConnectionAdapters
- Defined in:
- lib/rgeo/active_record/common_adapter_elements.rb
Overview
Provide methods for each geometric subtype during table changes.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
71 72 73 74 75 76 |
# File 'lib/rgeo/active_record/common_adapter_elements.rb', line 71 def self.included(base) base.class_eval do alias_method :method_missing_without_rgeo, :method_missing alias_method :method_missing, :method_missing_with_rgeo end end |
Instance Method Details
#method_missing_with_rgeo(method_name_, *args_, &block_) ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/rgeo/active_record/common_adapter_elements.rb', line 78 def method_missing_with_rgeo(method_name_, *args_, &block_) if @base.respond_to?(:spatial_column_constructor) && (info_ = @base.spatial_column_constructor(method_name_)) info_ = info_.dup type_ = (info_.delete(:type) || method_name_).to_s opts_ = args_..merge(info_) args_.each do |name_| @base.add_column(@table_name, name_, type_, opts_) end else method_missing_without_rgeo(method_name_, *args_, &block_) end end |