I have this model:
class Book < Item
validates :isbn, :presence => true, :uniqueness => true
has_many :book_chapters
has_many :chapters, :through => :book_chapters
searchable :auto_index => true, :auto_remove => true do
text :title
end
end
And I have this controller:
class HomeController < ApplicationController
def index
@search = Book.search do
fulltext params[:search]
end
@books = @search.results
[... normal rest of code ...]
end
end
The "title" field is inherited from the more general Item model. And when the Home controller tries to search, I get this error:
NoMethodError in HomeController index #
undefined method `closed? 'for nil: NilClass
The log also has this additional warning:
DEPARTMENT WARNING: class_inheritable_attribute is deprecated, use the class_attribute method instead. Note that their behavior is slightly different, so check the class_attribute documentation first. (called from /Users/xxx/Sites/zigzag/app/models/book.rb:7)
What pertains to the line:
for search: auto_index => true ,: auto_remove => true do
in book.rb
, ? , . , . Solr Admin . !