Open jess opened 7 years ago
I was seeing this too when I upgraded from refinery 2 to 3. My issue was that when I initially ported over the class names from the version 2 format, I wrote them like this:
Refinery::Search.configure do |config|
config.enable_for = [Refinery::Page, Refinery::Calendar::Event]
end
Because in v2, it is an array of classes, but in v3 they need to be strings:
Refinery::Search.configure do |config|
config.enable_for = ['Refinery::Page', 'Refinery::Calendar::Event']
end
I was seeing this issue even after I made the change, too, because I forgot to restart my server after fixing it.
Was getting this error. Traced it to the search engine model.
For some reason my
enable_for
configs are coming through as classes and not strings as is expected by thesearch_engine
model andsafe_constantize
is not defined on Active::Record classes. I had to comment out for it to work.https://github.com/jess/refinerycms-search/commit/1c277b9f9f0b8648e24b572d52b7f02c876df77e
This is what my search config looks like:
Any idea how an array of strings could be converted to an array of classes? I check code and can't find anything in the search gem that would suggest conversion.
I tried creating another array in the config and it comes out just fine:
Must not be an issue for anyone else, but thought I'd throw it out and see if anyone has suggestions.