Comments (7)
Yes, definitely seems like it. I'll look into it, it'll take some time, though. Couple of notes:
a) The implementation is quite isolated in support/forwardable.rb
, so it should be easy to tweak it.
b) I couldn't decide whether to use ActiveSupport
's delegation or not, in the end it would make more sense, I guess.
c) The implementation shouldn't trample on the delegate
method in your class, that's some unfortunate side-effect of using Forwardable
from Ruby's standard library, I think. That should be fixed.
from elasticsearch-rails.
Actual for me too :(
from elasticsearch-rails.
And for me
from elasticsearch-rails.
Looking into it... ripped out stdlib's Forwardable
, replaced with #delegate
, though there's a problem with ActiveRecord 3:
Due to inspect in https://github.com/rails/rails/blob/8dec2e7281a1b38db037dc23becd1a147d1fcae1/activesupport/lib/active_support/core_ext/module/delegation.rb#L179 I'm getting "Connection not established errors:.
gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
from .../gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from .../gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from .../gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/model_schema.rb:224:in `table_exists?'
from .../gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/base.rb:423:in `inspect'
from .../gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/core_ext/module/delegation.rb:137:in `to_s'
from .../gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/core_ext/module/delegation.rb:137:in `block in delegate'
from .../gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/core_ext/module/delegation.rb:125:in `each'
from .../gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/core_ext/module/delegation.rb:125:in `delegate'
from .../elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model.rb:105:in `singletonclass'
from .../elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model.rb:104:in `block in included'
from .../elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model.rb:79:in `class_eval'
from .../elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model.rb:79:in `included'
from elasticsearch-rails.
Replaced Forwardable
by ActiveSupport's delegate
, should be all set now.
Had to monkeypatch ActiveRecord::Base.inspect
on ActiveRecord < 4 to prevent errors mentioned above.
from elasticsearch-rails.
@karmi 👍
from elasticsearch-rails.
Cool! @karmi
from elasticsearch-rails.
Related Issues (20)
- NPE happens on short prefix query on a field with index_prefixes
- Indexes are not refreshing, even with refresh_interval being set
- Disable automatic callbacks in rspec
- Not getting any records from elasticsearch HOT 1
- FYI gem version 6.1.1 was pushed without any changes HOT 1
- elasticsearch-model 7.2.1 introduces circular dependency with ruby 2.7 and rubygems 3.2.5 HOT 1
- specify an alias near the index_name in an AR model HOT 1
- Illegal argument "type" sent in all requests upgrading to 8.x HOT 1
- Not able to update single record too please help me to here HOT 1
- How to import into two clusters
- Mapping Two Ruby on Rails Models with Different Attribute Names to a Shared Elasticsearch Index using 'elasticsearch-rails'
- update_document not selective enough
- Backward compatibility for older Elasticsearch version HOT 1
- Faraday::ConnectionFailed (end of file reached) HOT 1
- Elasticsearch - Unexpected Character Error (Minus Sign) HOT 1
- Unexpected behavior when searching from a scope
- Feature Suggestion - Get Indexed Document for Instance
- Deprecation warning in Rails 7.1 (support Rails 7.2) HOT 2
- ElasticSearch::Model does not register a subclass HOT 3
- rake elasticsearch:import:model - ArgumentError: unknown keyword: :type (ArgumentError)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch-rails.