Questions tagged [public-activity]

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

public_activity provides easy activity tracking for your ActiveRecord, Mongoid 3 and MongoMapper models in Rails 3 and 4.

Simply put: it can record what happens in your application and gives you the ability to present those recorded activities to users - in a similar way to how GitHub does it.

Github Repo

84 questions
0
votes
1 answer

Rspec Rails Testing for PublicActivity creation in controller test

I am testing the update method of a controller and part of the update creates a custom activity using the PublicActivity gem. When testing in Rspec the activities do not seem to be created. Here is the test that is failing: it "creates a shared…
mahi-man
  • 4,326
  • 2
  • 25
  • 36
0
votes
1 answer

Limit user to 1 like?

How can we limit a user to 1 like per comment? comments_controller.rb def like @comment = Comment.find(params[:id]) @comment.increment!(:likes) @comment.create_activity :like flash[:success] = 'Thanks for liking!' …
0
votes
2 answers

How to like comments?

Used http://www.sitepoint.com/activity-feeds-rails/ to add "Liking" feature to valuations. Within valuations#show people can comment. I want people to be able to also like comments. I used railscasts to enable polymorphic comments:…
AnthonyGalli.com
  • 2,796
  • 5
  • 31
  • 80
0
votes
2 answers

Using a Many-to-Many Relationship with the Public Activity gem in Rails

I have the scenario where an author has and belongs to many books, vice versa. Following the instructions for setting up associations in a one-to-many relationship works fine but when a many-to-many relationship introduced I get this error message…
0
votes
1 answer

Public_activity gem insert parameters as sql in Rails 3

I want to insert values to activities table using public_activity gem, but am not able to store records to parameters column in correct format. How to achieve this?? ActiveRecord::Base.connection.execute("INSERT INTO `activities`(`trackable_id`,…
Mani David
  • 1,382
  • 1
  • 14
  • 30
0
votes
1 answer

Using One-to-Many Associations for the Public Activity Rails gem

I just started using the PublicActivity gem and wanted to display the activities of authors throughout the site. In the app an author has many books. When an author releases a new book I'd like there to be a notification to appear in the feed's of…
Carl Edwards
  • 13,826
  • 11
  • 57
  • 119
0
votes
2 answers

How to access current_user in partial of public_activity gem?

When I m trying to access current_user in partial file it will contains nil value. I used devise gem for login process. I also used public_activity gem for generating notification. I have notification controller as below. def index @activities =…
sank
  • 964
  • 3
  • 12
  • 24
0
votes
1 answer

Error on a tracked object on creation with PublicActivity

I have a class FamilyTree that I am tracking with PublicActivity. The associations are as follows: User has_one :family_tree, dependent: :destroy has_many :memberships, dependent: :destroy has_many :nodes, dependent: :destroy Node include…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
0
votes
1 answer

paperclip error while displaying images

i get an error undefined method `photo' for # my posts.index.html.erb <%= image_tag @post.photo.url(:small) %> gives me the above error and if i iterate <% @post.each do |image| %> <%= image_tag…
user2903934
  • 59
  • 1
  • 11
0
votes
1 answer

I18n Show text with link inside

I'd like to a text that looks like: You created a new User But what i get is just a plain text: You crated a new User I'm using public_activity gem to track changes inside my app. Here is my…
gustavoca
  • 148
  • 12
0
votes
2 answers

Render_activity in a Bootstrap dropdown menu isn't working properly

So I am doing this in a Bootstrap dropdown menu in a partial in my main layout: <% @unread_act.each do |notification| %>
  • <%= render_activity notification %>
  • <% end %> @unread_act is declared in my…
    marcamillion
    • 32,933
    • 55
    • 189
    • 380
    0
    votes
    2 answers

    Alternative rails gems for public activity that shows labels for its respective destroyed records

    I have been trying the public_activity gem through the RailsCast tutorial and I just noticed that any data described in the activities can't be identified again once a record is destroyed, and I think this is a turn off on user experience. For…
    oLraX
    • 217
    • 4
    • 14
    0
    votes
    1 answer

    public_activity custom activities

    I try to store an activity using #create_activity from the public_activity gem: Model class Group < ActiveRecord::Base include PublicActivity::Common end Controller def send_invitation @user = User.where(email: params[:user][:email]) …
    clement
    • 71
    • 5
    0
    votes
    2 answers

    PublicActivity: Get All of User's Distinct Activities

    I'm using the Public Activity gem to track user's comments. I would like to get fetch all unique user comments in a query. I tried doing the following: PublicActivity::Activity.where(:trackable_type=>"Comment").where(:owner_id =>…
    scientiffic
    • 9,045
    • 18
    • 76
    • 149
    0
    votes
    2 answers

    Show public activity depending on it's key value

    Just stumbled upon this problem. I had a newsfeed that displayed a post. Containing a title and it's content. However now I added a new feature which is the comments model. Thus the keys saved in the activities table are no longer just 'post.create'…
    sja
    • 347
    • 1
    • 10