ruby - Rails gem - Public Activity for earlier posts -


the gem not recognize earlier post created before gem added. started working, when fresh posts created. why that?

and, how have earlier posts covered public_activity

thanks.
gem setup according author site.

you've create old activities manually using create_activity method. created rake task this.

task public_activity_migration: :environment   user.find_each |user|     [:comments, :friends].each |relation|       user.send(relation).find_each |obj|         obj.create_activity :create, owner: user, created_at: obj.created_at         print "."       end     end   end end 

the code above create activities comment , friend model. if you're not using strong params need allow created_at attribute set on publicactivity::activity model. can done adding following code before running task.

class publicactivity::activity   attr_accessible :created_at end 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -