No commit activity in last 3 years
No release in over 3 years
Case sensitive for attributes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
>= 0
~> 10.0

Runtime

~> 4.1.0
 Project Readme

CaseSensitiveAttributes

Installation

Add this line to your application's Gemfile:

gem 'case_sensitive_attributes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install case_sensitive_attributes

Usage

Set kinds for your attributes (eg. in User model)
class User < ActiveRecord::Base
 #case_sensitive_attributes column_name: :kind, column_name: :kind
  case_sensitive_attributes email: :downcase, first_name: :upcase
end
  • allow kinds: [:capitalize, :downcase, :upcase]
Set kinds for your params (form params or query string)
module Dummy
  class Application < Rails::Application
    config.middleware.insert_after ActionDispatch::ParamsParser, CaseSensitiveAttributes::Middleware do
     #params attribute: :kind
      params email: :downcase
    end
  end
  • allow kinds: [:capitalize, :downcase, :upcase]