lib/activity_feed/ohm/item.rb in activity_feed-1.2 vs lib/activity_feed/ohm/item.rb in activity_feed-1.2.1
- old
+ new
@@ -16,9 +16,22 @@
attribute :icon
attribute :sticky
after :save, :update_redis
+ def to_hash
+ super.merge(
+ :user_id => user_id,
+ :nickname => nickname,
+ :type => type,
+ :title => title,
+ :text => text,
+ :url => url,
+ :icon => icon,
+ :sticky => sticky
+ )
+ end
+
private
def update_redis
ActivityFeed.redis.zadd(ActivityFeed.feed_key(self.user_id), DateTime.parse(self.created_at).to_i, self.id)
end
\ No newline at end of file