Class: Chouette::Network

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

Constant Summary collapse

@@source_type_names =
nil

Instance Attribute Summary collapse

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

Instance Attribute Details

#source_type_nameObject

Returns the value of attribute source_type_name.



7
8
9
# File 'app/models/chouette/network.rb', line 7

def source_type_name
  @source_type_name
end

Class Method Details

.nullable_attributesObject



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

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



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

def self.object_id_key
  "PTNetwork"
end

.source_type_namesObject



42
43
44
45
46
# File 'app/models/chouette/network.rb', line 42

def self.source_type_names
  @@source_type_names ||= Chouette::SourceType.all.select do |source_type_name|
    source_type_name.to_i > 0
  end
end

Instance Method Details

#commercial_stop_areasObject



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

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

#stop_areasObject



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

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