Sha256: dfe7e5e8935b768c479b3734eea57a5a5a9da4fde383fffcaadcbde46c1294c8

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

module C80Push
  class Office < ActiveRecord::Base
    has_and_belongs_to_many :regions
    belongs_to :dealer

    default_scope -> { order(:ord => :asc) }

    validates :ord,
              :presence => true

    validates :title,
              :presence => true

    validates :addr,
              :presence => true

    validates :gps,
              :presence => true

    validates :tel,
              :presence => true

    def gps_arr
      self.gps.split(',').map! { |c| c.to_f }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
c80_push-0.1.0.2 app/models/c80_push/office.rb