diff options
| author | Xinhui | 2016-11-30 10:56:15 +0100 |
|---|---|---|
| committer | Xinhui | 2016-11-30 10:56:15 +0100 |
| commit | b5bf612f5359bfeaa5fb8d63a787c416ae457240 (patch) | |
| tree | e4d2d32469d6cf8b7cf4461122586f2282fa44bf | |
| parent | 9ae87f820d1f0083f6ec3813f3c80e86164c5abf (diff) | |
| download | chouette-core-b5bf612f5359bfeaa5fb8d63a787c416ae457240.tar.bz2 | |
Remove stop_area area_type itl
| -rw-r--r-- | app/controllers/autocomplete_stop_areas_controller.rb | 7 | ||||
| -rw-r--r-- | app/models/chouette/stop_area.rb | 16 | ||||
| -rw-r--r-- | config/locales/area_types.fr.yml | 1 | ||||
| -rw-r--r-- | spec/models/chouette/stop_area_spec.rb | 18 |
4 files changed, 5 insertions, 37 deletions
diff --git a/app/controllers/autocomplete_stop_areas_controller.rb b/app/controllers/autocomplete_stop_areas_controller.rb index 1e43f3968..31ecae9f5 100644 --- a/app/controllers/autocomplete_stop_areas_controller.rb +++ b/app/controllers/autocomplete_stop_areas_controller.rb @@ -17,8 +17,6 @@ class AutocompleteStopAreasController < InheritedResources::Base result = [] if physical_filter? result = referential.stop_areas.physical - elsif itl_exclude_filter? - result = Chouette::StopArea.where("area_type != 'ITL'") elsif target_type? && relation_parent? result = Chouette::StopArea.new( :area_type => params[ :target_type ] ).possible_parents elsif target_type? && relation_children? @@ -42,12 +40,7 @@ class AutocompleteStopAreasController < InheritedResources::Base params[ :relation ] == "children" end - def itl_exclude_filter? - params[:filter] == "itl_excluded" - end - def physical_filter? params[:filter] == "physical" end - end diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb index 72bfdf274..0d2595684 100644 --- a/app/models/chouette/stop_area.rb +++ b/app/models/chouette/stop_area.rb @@ -101,7 +101,6 @@ class Chouette::StopArea < Chouette::ActiveRecord when "Quay" then [] when "CommercialStopPoint" then Chouette::StopArea.where(:area_type => ['Quay', 'BoardingPosition']) - [self] when "StopPlace" then Chouette::StopArea.where(:area_type => ['StopPlace', 'CommercialStopPoint']) - [self] - when "ITL" then Chouette::StopArea.where(:area_type => ['Quay', 'BoardingPosition', 'StopPlace', 'CommercialStopPoint']) end end @@ -143,9 +142,6 @@ class Chouette::StopArea < Chouette::ActiveRecord where :area_type => [ "BoardingPosition", "Quay" ] end - def self.itl - where :area_type => "ITL" - end def to_lat_lng Geokit::LatLng.new(latitude, longitude) if latitude and longitude @@ -206,23 +202,13 @@ class Chouette::StopArea < Chouette::ActiveRecord end def stop_area_type - area_type + area_type ? area_type : " " end def stop_area_type=(stop_area_type) self.area_type = (stop_area_type ? stop_area_type.camelcase : nil) - if self.area_type == 'Itl' - self.area_type = 'ITL' - end end - # @@stop_area_types = nil - # def self.stop_area_types - # @@stop_area_types ||= Chouette::AreaType.all.select do |stop_area_type| - # stop_area_type.to_i >= 0 - # end - # end - def children_ids=(children_ids) children = children_ids.split(',').uniq # remove unset children diff --git a/config/locales/area_types.fr.yml b/config/locales/area_types.fr.yml index ddc0a8c56..b5b513368 100644 --- a/config/locales/area_types.fr.yml +++ b/config/locales/area_types.fr.yml @@ -5,4 +5,3 @@ fr: quay: "Quai" commercial_stop_point: "Arrêt commercial" stop_place: "Pôle d'échange" - itl: "ITL" diff --git a/spec/models/chouette/stop_area_spec.rb b/spec/models/chouette/stop_area_spec.rb index cdddb407d..e9e1514c9 100644 --- a/spec/models/chouette/stop_area_spec.rb +++ b/spec/models/chouette/stop_area_spec.rb @@ -1,11 +1,11 @@ require 'spec_helper' describe Chouette::StopArea, :type => :model do - let!(:quay) { create :stop_area, :area_type => "Quay" } + # FIXME !!!!!!!! + let!(:quay) { create :stop_area, :area_type => "zdep" } let!(:boarding_position) { create :stop_area, :area_type => "BoardingPosition" } - let!(:commercial_stop_point) { create :stop_area, :area_type => "CommercialStopPoint" } - let!(:stop_place) { create :stop_area, :area_type => "StopPlace" } - let!(:itl) { create :stop_area, :area_type => "ITL" } + let!(:commercial_stop_point) { create :stop_area, :area_type => "lda" } + let!(:stop_place) { create :stop_area, :area_type => "zdlp" } # Refs #1627 # describe '#objectid' do @@ -127,10 +127,6 @@ describe Chouette::StopArea, :type => :model do subject = create :stop_area, :stop_area_type => "stop_place" expect(subject.area_type).to eq("StopPlace") end - it "should have area_type of ITL when stop_area_type is set to itl" do - subject = create :stop_area, :stop_area_type => "itl" - expect(subject.area_type).to eq("ITL") - end end describe ".parent" do @@ -161,12 +157,6 @@ describe Chouette::StopArea, :type => :model do subject = create :stop_area, :area_type => "StopPlace" expect(subject.possible_children).to match_array([stop_place, commercial_stop_point]) end - - it "should find no children of type ITL for stop area type ITL" do - subject = create :stop_area, :area_type => "ITL" - expect(subject.possible_children).to match_array([stop_place, commercial_stop_point, quay, boarding_position]) - end - end describe ".possible_parents" do |
