Sha256: ee83bdb05773acf9f3a6d28b5bf9c31304e96f5993284e1a5535fad651d4755f

Contents?: true

Size: 892 Bytes

Versions: 12

Compression:

Stored size: 892 Bytes

Contents

class Chouette::GroupOfLine < Chouette::TridentActiveRecord
  # FIXME http://jira.codehaus.org/browse/JRUBY-6358
  self.primary_key = "id"
  
  has_and_belongs_to_many :lines, :class_name => 'Chouette::Line', :order => 'lines.name'

  validates_presence_of :name

  attr_accessible :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :lines  
  attr_accessible :line_tokens
  attr_reader :line_tokens
  
  def self.nullable_attributes
    [:comment]
  end
  
  def commercial_stop_areas
    Chouette::StopArea.joins(:children => [:stop_points => [:route => [:line => :group_of_lines] ] ]).where(:group_of_lines => {:id => self.id}).uniq
  end

  def stop_areas
    Chouette::StopArea.joins(:stop_points => [:route => [:line => :group_of_lines] ]).where(:group_of_lines => {:id => self.id})
  end
  
  def line_tokens=(ids)
    self.line_ids = ids.split(",")
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ninoxe-1.1.3 app/models/chouette/group_of_line.rb
ninoxe-1.1.2 app/models/chouette/group_of_line.rb
ninoxe-1.1.1 app/models/chouette/group_of_line.rb
ninoxe-1.1.0 app/models/chouette/group_of_line.rb
ninoxe-1.0.3 app/models/chouette/group_of_line.rb
ninoxe-1.0.2 app/models/chouette/group_of_line.rb
ninoxe-1.0.1 app/models/chouette/group_of_line.rb
ninoxe-1.0.0 app/models/chouette/group_of_line.rb
ninoxe-0.1.6 app/models/chouette/group_of_line.rb
ninoxe-0.1.5 app/models/chouette/group_of_line.rb
ninoxe-0.1.4 app/models/chouette/group_of_line.rb
ninoxe-0.1.3 app/models/chouette/group_of_line.rb