Sha256: e63de95d899e30139fd6ffc006d48101aaeb8796c8b8fedecf6b825fd0bccced

Contents?: true

Size: 704 Bytes

Versions: 8

Compression:

Stored size: 704 Bytes

Contents

# == Schema Information
#
# Table name: contacts
#
#  id           :integer          not null, primary key
#  customer_id  :integer
#  last_name    :string(50)
#  first_name   :string(50)
#  email        :string(100)
#  created_at   :datetime
#  updated_at   :datetime
#  contact_type :string(20)
#

module CgAppBase
  class Contact < ActiveRecord::Base
    include AttributesNormalizer

    default_scope { order(display: :desc, first_name: :asc) }

    def excluded_normalized_attrs
      [:email]
    end

    has_paper_trail

    validates :last_name, :first_name, :presence => true

    has_many :phones, dependent: :destroy

    accepts_nested_attributes_for :phones, allow_destroy: true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cg_app_base-1.1.1 app/models/cg_app_base/contact.rb
cg_app_base-1.0.78 app/models/cg_app_base/contact.rb
cg_app_base-1.0.62 app/models/cg_app_base/contact.rb
cg_app_base-1.0.56 app/models/cg_app_base/contact.rb
cg_app_base-1.0.55 app/models/cg_app_base/contact.rb
cg_app_base-1.0.54 app/models/cg_app_base/contact.rb
cg_app_base-1.0.52 app/models/cg_app_base/contact.rb
cg_app_base-1.0.51 app/models/cg_app_base/contact.rb