2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-22 01:47:48 +00:00

Fixed message for validation error on wiki_page.

--HG--
branch : 3.0-stable
This commit is contained in:
Edho Arief 2012-07-11 23:19:31 +07:00
parent d0bb265e08
commit 85229411ed
3 changed files with 8 additions and 11 deletions

View File

@ -129,7 +129,7 @@ class WikiController < ApplicationController
if @page.save
respond_to_success("Page reverted", :action => "show", :title => params[:title])
else
respond_to_error("Error reverting page", { :action => 'show', :title => params[:title] })
respond_to_error((@page.errors.full_messages.first rescue "Error reverting page"), { :action => 'show', :title => params[:title] })
end
end
end

View File

@ -107,15 +107,8 @@ class WikiPage < ActiveRecord::Base
protected
def ensure_changed
changed = false
latest = self.versions.latest
if self.body != latest.body
changed = true
elsif self.title != latest.title
changed = true
elsif self.is_locked != latest.is_locked
changed = true
unless (changed & ['title', 'body']).any?
errors.add :base, :no_change
end
return changed
end
end

View File

@ -106,7 +106,7 @@ en:
moderate:
uploaded_by_when_html: Uploaded by %{u} %{t_ago} (%{mod})
mod: mod
#models
# ActiveRecord (models)
activerecord:
attributes:
#user.attributes
@ -114,6 +114,10 @@ en:
password: Password
current_password: Current password
password_confirmation: Password confirmation
errors:
models:
wiki_page:
no_change: No change in page content/title
#view/artist/create
artist_create: "Separate multiple aliases and group members with commas."
artist_name: "Name"