0.0
No commit activity in last 3 years
No release in over 3 years
Sequel plugin which lets you set a sanitization method on specific fields
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 3.0.0
 Project Readme

sequel_sanitize¶ ↑

Install¶ ↑

Add gemcutter.org source if you don’t have it:

gem source http://gemcutter.org

Install:

[sudo] gem install sequel_sanitize

Usage¶ ↑

This plug-in provide functionality to allow Sequel::Model to have fields sanitized with a defined or default method.

To use plug-in you add plug-in to your model:

class MyModel < Sequel::Model
  plugin :sanitize, :fields => [:first_name, :last_name], :sanitizer => :name_sanitizer
  plugin :sanitize, :fields => [:email], :downcase => true
end

You can use following options:

fields

an array of the fields that the sanitizer method should be applied to

sanitizer

Proc or Symbol to call to sanitize the value of the field.

downcase

Set to true to downcase the value returned from the sanitizer

Options sanitizer and downcase are optional.

Options are inherited when you use inheritance for your models. However you can only set options via plugin method.

If you don’t provide a :sanitizer, the default sanitizer method will strip whitespace

Copyright © 2011 Kevin Tom. See LICENSE for details.