aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/lines_controller.rb
diff options
context:
space:
mode:
authorZog2017-12-20 17:48:17 +0100
committerAlban Peignier2017-12-21 21:35:02 +0100
commite8285678efc9a62115fe0af4086c7a3959666bf8 (patch)
tree64b18197dff4d6707be10bfccca9240c601ffded /app/controllers/lines_controller.rb
parent01b2d2b785d99c9b031269fc741b70ee9c248f16 (diff)
downloadchouette-core-e8285678efc9a62115fe0af4086c7a3959666bf8.tar.bz2
Refs #5349 @1h; Deactivate StopAreas instead of destroying them5349-deactivate-stop-areas
- Update decorators (had to split `action_links` because of `StopPointDecorator` inheriting from `StopAreaDecorator`) - Add methods on model - Add routes - Add actions on controller (`Activatable` concern, shared with `LinesController`) - Add I18n keys
Diffstat (limited to 'app/controllers/lines_controller.rb')
-rw-r--r--app/controllers/lines_controller.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index 676581076..f446e1d37 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -1,6 +1,8 @@
class LinesController < ChouetteController
include ApplicationHelper
+ include Activatable
include PolicyChecker
+
defaults :resource_class => Chouette::Line
respond_to :html
respond_to :xml
@@ -50,14 +52,6 @@ class LinesController < ChouetteController
super
end
- %w(activate deactivate).each do |action|
- define_method action do
- authorize resource, "#{action}?"
- resource.send "#{action}!"
- redirect_to request.referer || [resource.line_referential, resource]
- end
- end
-
# overwrite inherited resources to use delete instead of destroy
# foreign keys will propagate deletion)
def destroy_resource(object)