Skip to content

Commit

Permalink
Merge branch 'release/0.6.18.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed May 18, 2016
2 parents 7133a57 + 9870f85 commit 43a5dde
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/web/admin/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def update
@image_form = ImageForm.find_with_model params[:id]
@image_form.submit(params[:image])
if @image_form.save
redirect_to edit_admin_image_path @image_form.model
redirect_to admin_image_path @image_form.model
else
choose_users
render action: :edit
Expand Down
2 changes: 1 addition & 1 deletion app/models/redirect_rule.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class RedirectRule < ActiveRecord::Base
validates :old_path, presence: true,
uniqueness: true
uniqueness: { scope: :state }
validates :redirect_to, presence: true

extend Enumerize
Expand Down
4 changes: 3 additions & 1 deletion app/views/layouts/web/admin/shared/_messages.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
- if object.errors.any?
- if object.errors.any? || object.model.errors.any?
.alert.alert-dismissible.alert-danger
%h4= t('.some_errors_was_found')
%ul
- object.errors.full_messages.each do |message|
%li= message
- object.model.errors.full_messages.each do |message|
%li= message
- elsif form_after_save? && object_updated_less_minute_ago?(object)
.alert.alert-dismissible.alert-success
%h4= t('messages.record_saved_success')
Expand Down

0 comments on commit 43a5dde

Please sign in to comment.