diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index 61db6b1..18782f3 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -25,14 +25,12 @@ class AppsController < InheritedResources::Base end def new - build_resource.watchers.build - @app.issue_tracker = IssueTracker.new + plug_params build_resource new! end def edit - resource.watchers.build if resource.watchers.none? - resource.issue_tracker = IssueTracker.new if resource.issue_tracker.nil? + plug_params resource edit! end @@ -45,6 +43,11 @@ class AppsController < InheritedResources::Base {:app_name => resource.name} end + def plug_params app + app.watchers.build if app.watchers.none? + app.issue_tracker = IssueTracker.new if app.issue_tracker.nil? + end + # email_at_notices is edited as a string, and stored as an array. def parse_email_at_notices_or_set_default if params[:app] && val = params[:app][:email_at_notices] -- libgit2 0.21.2