acts_as_snapchat!!
Have you ever wanted Active Record to behave like Snapchat? It's finally here! When a record is more than ten seconds old, it won't appear in any of your queries.
Installation
Add this line to your application's Gemfile:
gem 'acts_as_snapchat'
Usage
To make any model act as snapchat, just include acts_as_snapchat
in your class definition:
class User < ActiveRecord::Base
acts_as_snapchat
# ...
end
And then stuff will happen:
User.create!
User.count # => 1
sleep 10
User.count # => 0
If you're a Node.js developer, you may be more comfortable using the alias acts_as_mongodb
.
Contributing
- Fork it ( https://github.com/vanruby/acts_as_snapchat/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request