Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

giraffesoft-dirty_callbacks

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

giraffesoft-dirty_callbacks

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= Dirty Callbacks

Dirty callbacks is an active record plugin that adds some callbacks for tracking changes to fields.

Currently, it adds two types of callbacks:

before_field_changes_on_update & after_field_changed_on_update

This allows you to hook a callback in to the save cycle that only gets called if a particular field is changed in the save.

This is especially useful in conjunction with my {observational}[http://github.com/giraffesoft/observational] plugin.

== Installation

sudo gem install giraffesoft-dirty_callbacks

== Usage

To get dirty callbacks, you need to include the module in the model you want to use it in.

Then, just declare the callbacks as normal:

class User < ActiveRecord::BAse include DirtyCallbacks

before_email_changes_on_update :do_stuff

protected
def do_stuff
  puts email_was
  puts email
end

end

== Copyright

Copyright (c) 2009 James Golick. See LICENSE for details.

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc