Sha256: f424ad08d5816b34b6667dd6c617eef4f77011001f1f8ace88c985a738af90fb

Contents?: true

Size: 689 Bytes

Versions: 4

Compression:

Stored size: 689 Bytes

Contents

class CoworkingSpace < MLS::Model
  include MLS::Slugger
  include MLS::Avatar
  
  belongs_to  :organization
  belongs_to  :property
  has_many    :image_orderings, as: :subject
  has_many    :photos, through: :image_orderings, source: :image
  has_many    :spaces
  has_many    :addresses, :through => :property
  
  has_many    :ownerships, as: :asset
  has_many    :accounts, through: :ownerships
  
  accepts_nested_attributes_for :spaces, :ownerships, :accounts
  
  def display_name
    output = organization.name
    output += " - " + read_attribute(:name) if read_attribute(:name)
    output
  end
  
  def longitude
    location.x
  end

  def latitude
    location.y
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mls-1.9.0 lib/mls/models/coworking_space.rb
mls-1.8.0 lib/mls/models/coworking_space.rb
mls-1.7.0 lib/mls/models/coworking_space.rb
mls-1.6.0 lib/mls/models/coworking_space.rb