@@ -18,7 +18,7 @@ def new
1818
1919 def create
2020 if @invalidation . save
21- redirect_to admin_invalidations_url , notice : "Invalidation created successfully"
21+ redirect_to admin_invalidations_url , notice : :invalidation_created
2222 else
2323 respond_to do |format |
2424 format . html { render :new }
@@ -32,69 +32,69 @@ def edit
3232 format . html
3333 end
3434 else
35- redirect_to_index_url notice : "Can't edit invalidations that aren't pending"
35+ redirect_to_index_url notice : :invalidation_cant_be_edited
3636 end
3737 end
3838
3939 def update
4040 if @invalidation . pending?
4141 if @invalidation . update ( invalidation_params )
42- redirect_to admin_invalidations_url , notice : "Invalidation updated successfully"
42+ redirect_to admin_invalidations_url , notice : :invalidation_updated
4343 else
4444 respond_to do |format |
4545 format . html { render :edit }
4646 end
4747 end
4848 else
49- redirect_to_index_url notice : "Can't edit invalidations that aren't pending"
49+ redirect_to_index_url notice : :invalidation_cant_be_edited
5050 end
5151 end
5252
5353 def destroy
5454 if @invalidation . started?
55- redirect_to_index_url notice : "Can't remove invalidations that have started"
55+ redirect_to_index_url notice : :invalidation_cant_be_removed
5656 else
5757 if @invalidation . destroy
58- redirect_to_index_url notice : "Invalidation removed successfully"
58+ redirect_to_index_url notice : :invalidation_removed
5959 else
60- redirect_to_index_url alert : "Invalidation could not be removed - please contact support"
60+ redirect_to_index_url alert : :invalidation_not_removed
6161 end
6262 end
6363 end
6464
6565 def cancel
6666 if @invalidation . completed?
67- redirect_to_index_url notice : "Can't cancel invalidations that have completed"
67+ redirect_to_index_url notice : :invalidation_cant_be_cancelled
6868 else
6969 if @invalidation . cancel!
70- redirect_to_index_url notice : "Invalidation cancelled successfully"
70+ redirect_to_index_url notice : :invalidation_cancelled
7171 else
72- redirect_to_index_url alert : "Invalidation could not be cancelled - please contact support"
72+ redirect_to_index_url alert : :invalidation_not_cancelled
7373 end
7474 end
7575 end
7676
7777 def count
7878 if @invalidation . pending?
7979 if @invalidation . count!
80- redirect_to_index_url notice : "Counted the matching signatures for invalidation #{ @invalidation . summary . inspect } "
80+ redirect_to_index_url notice : [ :invalidation_counted , summary : @invalidation . summary . inspect ]
8181 else
82- redirect_to_index_url alert : "Invalidation could not be counted - please contact support"
82+ redirect_to_index_url alert : :invalidation_not_counted
8383 end
8484 else
85- redirect_to_index_url notice : "Can't count invalidations that aren't pending"
85+ redirect_to_index_url notice : :invalidation_cant_be_counted
8686 end
8787 end
8888
8989 def start
9090 if @invalidation . pending?
9191 if @invalidation . start!
92- redirect_to_index_url notice : "Enqueued the invalidation #{ @invalidation . summary . inspect } "
92+ redirect_to_index_url notice : [ :invalidation_started , summary : @invalidation . summary . inspect ]
9393 else
94- redirect_to_index_url alert : "Invalidation could not be enqueued - please contact support"
94+ redirect_to_index_url alert : :invalidation_not_started
9595 end
9696 else
97- redirect_to_index_url notice : "Can't start invalidations that aren't pending"
97+ redirect_to_index_url notice : :invalidation_cant_be_started
9898 end
9999 end
100100
0 commit comments