Closed woto closed 7 years ago
@woto try this:
searchkick (...options here) unless respond_to?(:searchkick_index)
@ronzalo Yeah, it works, it seems i saw same technique somewhere. But i had not tried it because i thought that it's not a correct way.
@woto I'm experiencing the same issue with a user_decorator.rb
file. When I have a validates
defined, it get's called twice, meaning I get double the error message output. And it only happens in staging/production.
Suggestions?
Sorry, nope, i don't working on this task anymore
14 дек. 2016 г. 5:32 AM пользователь "Joel Taylor" notifications@github.com написал:
@woto https://github.com/woto I'm experiencing the same issue with a user_decorator.rb file. When I have a validates defined, it get's called twice, meaning I get double the error message output. And it only happens in staging/production.
Suggestions?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ronzalo/spree_searchkick/issues/7#issuecomment-266925595, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI9EMiP7PAgAl0AYP7GweMMl4vqFrmDks5rH1VPgaJpZM4IPadz .
@joelataylor it's a searchkick issue, see https://github.com/ankane/searchkick/issues/596
@joelataylor Since searchkick does not allow you to call more than once, you can add this to override the behavior
self.class_variable_set :@@searchkick_options, {}
@joelataylor I got the same problem. Did you find a way to fix it?
@FX-HAO sorry, I can't remember what the fix was!
hi guys, knowing that searchkick doesn't allow to override inherited method (see https://github.com/ankane/searchkick/issues/313), the correct way (imho) to solve this is move that logic out of the gem and put it on the project itself
@joelataylor Since searchkick does not allow you to call more than once, you can add this to override the behavior
self.class_variable_set :@@searchkick_options, {}
For me works this way. And also can change value of class variables @@searchkick_index, @@searchkick_klass, @@searchkick_index_cache
in a method class, and make a wrapper function of search
for use in default method.
Hi in production environment i've got this error
It seems it happens because of prouct_decorator.rb locaded twice
i've added
to product_decorator.rb for debugging.
When i commenting out
config.to_prepare &method(:activate).to_proc
inlib/spree_searchkick/engine.rb
the error is gone. Still don't know why it happens. Nobody else don't have this problem?