Class: Chouette::Network

Inherits:
TridentActiveRecord show all
Defined in:
app/models/chouette/network.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TridentActiveRecord

#build_objectid, #clean_object_id, #default_values, #fix_uniq_objectid, model_name, #objectid, #objectid_format_compliance, #prefix, #prepare_auto_columns, #reset_auto_columns, #timestamp_attributes_for_create, #timestamp_attributes_for_update, #uniq_objectid

Methods inherited from ActiveRecord

#human_attribute_name, #nil_if_blank

Class Method Details

.nullable_attributesObject



19
20
21
# File 'app/models/chouette/network.rb', line 19

def self.nullable_attributes
  [:source_name, :source_type, :source_identifier, :comment]
end

.object_id_keyObject

attr_accessible :objectid, :object_version, :creation_time, :creator_id, :version_date, :description, :name attr_accessible :registration_number, :source_name, :source_type, :source_identifier, :comment



15
16
17
# File 'app/models/chouette/network.rb', line 15

def self.object_id_key
  "GroupOfLine"
end

Instance Method Details

#commercial_stop_areasObject



23
24
25
# File 'app/models/chouette/network.rb', line 23

def commercial_stop_areas
  Chouette::StopArea.joins(:children => [:stop_points => [:route => [:line => :network] ] ]).where(:networks => {:id => self.id}).uniq
end

#stop_areasObject



27
28
29
# File 'app/models/chouette/network.rb', line 27

def stop_areas
  Chouette::StopArea.joins(:stop_points => [:route => [:line => :network] ]).where(:networks => {:id => self.id})
end