acts_as_follower
acts_as_follower copied to clipboard
acts_as_follower doesn't play nice with searchlogic
Hi,
I have Users following Companies, and that works very well using the irb. When I try to integrate that setup with SearchLogic tho, it returns to me an error:
>> User.find(1).following_companies.count
2
>> User.find(1).following_companies.search
NoMethodError: undefined method `search' for #<Array:0x107465db8>
from (irb):16
>>
By the way, when I just do Company.search, it works fine.
so, this may now work on the rails3 branch of the plugin (on this branch) as the _type methods now return a collection not an array
See the following commit: http://github.com/tcocca/acts_as_follower/commit/72bca0bf06ed226fc658f60a2140af21a622cc91
Also, see this ticket: http://github.com/tcocca/acts_as_follower/issues#issue/4
and the rails3 branch: http://github.com/tcocca/acts_as_follower/tree/rails3
I don't think I will be porting this back to the current master branch (rails 2.3.x), if you would like to give it a shot please be my guest, however not that that commit takes advantage of the new ARel and AR3 query syntax.
~ Tom