Sha256: d0e3501a7fa690ff16e5b74bd422e28a7e3ec6245ac7aa4b44badd4d47d7459d

Contents?: true

Size: 354 Bytes

Versions: 4

Compression:

Stored size: 354 Bytes

Contents

require 'active_record'

module ActivityFeed
  module ActiveRecord
    class Item < ::ActiveRecord::Base
      set_table_name 'activity_feed_items'
        
      after_save :update_redis

      private

      def update_redis
        ActivityFeed.redis.zadd(ActivityFeed.feed_key(self.user_id), self.created_at.to_i, self.id)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activity_feed-1.4.0 lib/activity_feed/active_record/item.rb
activity_feed-1.3.0 lib/activity_feed/active_record/item.rb
activity_feed-1.2.1 lib/activity_feed/active_record/item.rb
activity_feed-1.2 lib/activity_feed/active_record/item.rb