0.0
No commit activity in last 3 years
No release in over 3 years
Call action on ActiveRecord Fields
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
~> 10.0

Runtime

>= 4.0.0
 Project Readme

ActionField

Call actions on ActiveRecord fields before update or create.

Usage

Simple

  action_field strip: [:first_name, :last_name]

The above code will call strip method on first_name, and last_name to field before update or create.

More granular callback control

  action_field strip: [:first_name, :last_name], on: [:create]

The above code will call strip method on first_name, and last_name to field before create.

License

The code is on MIT license, feel free to use it or fork it. Or even send me a PR.