Displaying 1 result from an estimated 1 matches for "card_verif".
2010 Aug 13
2
Rails 3 / ActiveModel for Credit Card information?
...s like this....
class CreditCard
include ActiveModel::Validations
include ActiveModel::AttributeMethods
include ActiveModel::Callbacks
include ActiveModel::Conversion
extend ActiveModel::Naming
# belongs_to :user
attr_accessor :card_type, :card_number, :card_verification, :card_expires_on, :agree
validates :card_type, :card_number, :card_verification, :card_expires_on, :agree, :presence
=> true
def initialize(attributes = {})
expire_date = {}
#raise attributes.inspect
attributes.each do |name, value|
send("...