Sha256: 1d5c0f9c9ff678fe7a74514d2e9980d86c8a68b8f3b6cc92612b7fe89b47538c

Contents?: true

Size: 334 Bytes

Versions: 2

Compression:

Stored size: 334 Bytes

Contents

class Customer < ActiveRecord::Base
    validates :first_name, presence: true
    validates :last_name, presence: true
    validates :phone_number, numericality: true

    has_many :invoices, :dependent => :destroy
    has_paper_trail

    def name
        "#{first_name} #{last_name}"
    end

    def to_s
        name
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
app_kit-0.0.2 spec/dummy/app/models/customer.rb
app_kit-0.0.1 spec/dummy/app/models/customer.rb