Recent Changes - Search:

edit SideBar


Firefox 2
Get Thunderbird!

AttributePresent

Rails.AttributePresent History

Hide minor edits - Show changes to markup

April 04, 2007, at 10:25 PM by 85.105.66.26
Added lines 1-9:

(:code:) class CreditCard < ActiveRecord::Base # Strip everything but digits, so the user can specify "555 234 34" or # "5552-3434" or both will mean "55523434" def before_validation_on_create self.number = number.gsub(/[^0-9]/, "") if attribute_present?("number") end end

Edit - History - Print - Recent Changes - Search
Page last modified on April 04, 2007, at 10:25 PM