Module: Elastics::ActiveRecord::HelperMethods
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/elastics/active_record/helper_methods.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #delete_elastics ⇒ Object
- #index_elastics ⇒ Object
- #update_elastics(data) ⇒ Object
- #update_elastics_doc(fields) ⇒ Object
Instance Method Details
#delete_elastics ⇒ Object
92 93 94 95 |
# File 'lib/elastics/active_record/helper_methods.rb', line 92 def delete_elastics self.class.request_elastics(method: :delete, id: id) rescue NotFound end |
#index_elastics ⇒ Object
80 81 82 |
# File 'lib/elastics/active_record/helper_methods.rb', line 80 def index_elastics self.class.request_elastics(method: :post, id: id, body: to_elastics) end |
#update_elastics(data) ⇒ Object
84 85 86 |
# File 'lib/elastics/active_record/helper_methods.rb', line 84 def update_elastics(data) self.class.request_elastics(method: :post, id: "#{id}/_update", body: data) end |
#update_elastics_doc(fields) ⇒ Object
88 89 90 |
# File 'lib/elastics/active_record/helper_methods.rb', line 88 def update_elastics_doc(fields) update_elastics(doc: fields) end |