I think it's before_validation... and you'd probably want something more like:
This way the value is actually being stored in the database :)
On 06/08/2010, at 4:39 PM, Mike Disuza wrote:
> I am trying your solution like this
> My model is like this:-
> before_validate :cache_rating
> define_index do
> indexes :name,:sortable => true
> indexes cached_rating, :as=>:property_rating
> def cache_rating
> Whenever I am trying to rebuild the indexing using "rake ts:rebuild",
> I am getting error "undefined method `before_validate' for #<Class:
> Can anyone help me out.
> On Aug 5, 11:38 am, James Healy <ji...@deefa.com> wrote:
>>> Can anyone have any idea how to solve this?
>> I'm not familiar with the acts_as_a_rateable plugin, but you probably
>> * find out if the plugin stores the rating in your database somewhere
>> * if the rating is purely calculated in ruby, you will have to add a
>> -- James Healy <ji...@deefa.com> Thu, 05 Aug 2010 16:37:45 +1000
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.