public-activity / public_activity

Easy activity tracking for models - similar to Github's Public Activity

Home Page:https://github.com/pokonski/public_activity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Try to update model using rake task

MuhammadRazaAslam opened this issue · comments

I am update model from rake task.But i try to run rake rake task, it throws an exception and not updating record.

Here is my model file.

class Product < ActiveRecord::Base

include PublicActivity::Model
tracked owner: Proc.new{ |controller, model| controller.current_user }
end

Error Message: NoMethodError: undefined method `current_user' for nil:NilClass

Let me know how i can update product record using rake task.

Whats the solution to this problem then?
What if i am updating a model using APIs?