Reputation: 2289
I'm trying to update data in database using after_create callback I wrote
Dm::Advertisement.where (:type => Dm::Advertisement).update_all(ads_counter: 0)
in my model , but have SyntaxError. Can anyone point me where i did mistake?
Upvotes: 1
Views: 106
Reputation: 6026
Dm::Advertisement.where (:type => Dm::Advertisement).update_all(:ads_counter => 0 )
Upvotes: 1
Reputation: 47472
Dm::Advertisement.where (:type => Dm::Advertisement).update_all("ads_counter =0")
Upvotes: 1