Sha256: 47c97e1f1cc0296606915a89077931b6385bfe7f0c13d092a100c43fb1f7e232

Contents?: true

Size: 382 Bytes

Versions: 3

Compression:

Stored size: 382 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.namespace}:#{ActivityFeed.key}:#{self.user_id}", self.created_at.to_i, self.id)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activity_feed-1.1.1 lib/activity_feed/active_record/item.rb
activity_feed-1.1.0 lib/activity_feed/active_record/item.rb
activity_feed-1.0.0 lib/activity_feed/active_record/item.rb