pat / thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
http://freelancing-gods.com/thinking-sphinx
MIT License
1.63k stars 470 forks source link

Don't load ActiveRecord during rails initialization #1194

Closed jdelStrother closed 3 years ago

jdelStrother commented 3 years ago

If ThinkingSphinx requires ActiveRecord on load, then setting configuration in applications' initializers with have no effect (eg Rails.application.config.active_record.has_many_inversing).

Instead, ActiveRecord should be deferred to the end of initialization using the Railtie. WDYT to something like this?

pat commented 3 years ago

Looks good to me - and thanks for figuring out the fix! Must have been a frustrating thing to debug.