0.0
No commit activity in last 3 years
No release in over 3 years
Know what ActiveRecord objects touched by another
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 10.0
~> 3.0

Runtime

 Project Readme

TouchTouch

Record who touched whom without saving it in the database! This is using Redis instead.

Installation

$ gem install touch_touch

Usage

In your "toucher" ActiveRecord class:

class AdminUser < ActiveRecord::Base
  include TouchTouch::Toucher

  # Lead is the "touchee" class
  # Choose to only store 5 at a time in the queue
  touch_alias :recently_searched, {class: Lead, limit: 5}
end

You can now do this:

admin_user = AdminUser.first
lead = Lead.first
admin_user.recently_searched(lead)

# returns an array of recently searched leads
admin_user.recently_searched_leads

Todos

  • Lots

License

The gem is available as open source under the terms of the MIT License.