diff options
Diffstat (limited to 'app/models/route_section_search.rb')
| -rw-r--r-- | app/models/route_section_search.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/app/models/route_section_search.rb b/app/models/route_section_search.rb deleted file mode 100644 index bf53cdf05..000000000 --- a/app/models/route_section_search.rb +++ /dev/null @@ -1,33 +0,0 @@ -class RouteSectionSearch - include ActiveModel::Conversion - extend ActiveModel::Naming - - attr_accessor :departure_name, :arrival_name, :line_id - attr_accessor :scope - - def scope - scope ||= Chouette::RouteSection - end - - def initialize(attributes = {}) - attributes.each { |k,v| send "#{k}=", v } if attributes - end - - def collection - collection = scope - - [:departure, :arrival].each do |endpoint| - endpoint_name = send "#{endpoint}_name" - collection = collection.by_endpoint_name(endpoint, endpoint_name) if endpoint_name.present? - end - - collection = collection.by_line_id(line_id) if line_id.present? - - collection - end - - def persisted? - false - end - -end |
