Commit 237744e5238dac7144a1c5eb4748367b9377770e
1 parent
4be375ef
Exists in
master
and in
1 other branch
Plugging app params for new & edit actions.
Showing
1 changed file
with
7 additions
and
4 deletions
Show diff stats
app/controllers/apps_controller.rb
| ... | ... | @@ -25,14 +25,12 @@ class AppsController < InheritedResources::Base |
| 25 | 25 | end |
| 26 | 26 | |
| 27 | 27 | def new |
| 28 | - build_resource.watchers.build | |
| 29 | - @app.issue_tracker = IssueTracker.new | |
| 28 | + plug_params build_resource | |
| 30 | 29 | new! |
| 31 | 30 | end |
| 32 | 31 | |
| 33 | 32 | def edit |
| 34 | - resource.watchers.build if resource.watchers.none? | |
| 35 | - resource.issue_tracker = IssueTracker.new if resource.issue_tracker.nil? | |
| 33 | + plug_params resource | |
| 36 | 34 | edit! |
| 37 | 35 | end |
| 38 | 36 | |
| ... | ... | @@ -45,6 +43,11 @@ class AppsController < InheritedResources::Base |
| 45 | 43 | {:app_name => resource.name} |
| 46 | 44 | end |
| 47 | 45 | |
| 46 | + def plug_params app | |
| 47 | + app.watchers.build if app.watchers.none? | |
| 48 | + app.issue_tracker = IssueTracker.new if app.issue_tracker.nil? | |
| 49 | + end | |
| 50 | + | |
| 48 | 51 | # email_at_notices is edited as a string, and stored as an array. |
| 49 | 52 | def parse_email_at_notices_or_set_default |
| 50 | 53 | if params[:app] && val = params[:app][:email_at_notices] | ... | ... |