Module: ActiveRecord::ConnectionAdapters::Elasticsearch::UnsupportedImplementation

Extended by:
ActiveSupport::Concern
Included in:
ActiveRecord::ConnectionAdapters::ElasticsearchAdapter
Defined in:
lib/active_record/connection_adapters/elasticsearch/unsupported_implementation.rb

Class Method Summary collapse

Class Method Details

.define_unsupported_method(*method_names) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/active_record/connection_adapters/elasticsearch/unsupported_implementation.rb', line 10

def define_unsupported_method(*method_names)
  method_names.each do |method_name|
    module_eval <<-RUBY, __FILE__, __LINE__ + 1
      def #{method_name}(*args)
        raise NotImplementedError, "'##{method_name}' is originally defined by 'ActiveRecord::ConnectionAdapters' but is not supported by Elasticsearch. Choose a different solution to prevent the execution of this method!"
      end
    RUBY
  end
end