Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (10 sloc) 368 Bytes
Namecase
========
This is a trivial plugin that tries to fix the case of a string if it is given a string that is all caps or all lower case
class Person < ActiveRecord::Base
namecase :first_name, :on => :create
end
>> Person.create(:first_name => 'larry').first_name
=> "Larry"
>> Person.create(:first_name => 'ANNOYING').first_name
=> "Annoying"