wvanbergen/scoped_search — Issue #16: Can't init variables when searching on associated records
Author: refaelos
Created: 2012-01-26 20:25:13+00:00
State: open

class Post < ActiveRecord::Base
scoped_search :on => [:name, :description]
scoped_search :in => :user, :on => [:first_name, :last_name]

after_initialize :init

def init
self.publish_time ||= DateTime.now
end
end

In the above example i get "missing attribute: publish_time". If i comment out "scoped_search :in => :user, :on => [:first_name, :last_name]" it works well but i can't search on the associated User.

Any ideas how to fix this ?