Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change the i18n default name to :"unauthorized.default"

  • Loading branch information...
commit 1c3e61725f4e88e14271304f47bec129a13c7c1b 1 parent 71f60bc
Nicolás Hock-Isaza nhocki authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/cancan/exceptions.rb
  2. +1 −1  spec/cancan/exceptions_spec.rb
2  lib/cancan/exceptions.rb
View
@@ -40,7 +40,7 @@ def initialize(message = nil, action = nil, subject = nil)
@message = message
@action = action
@subject = subject
- @default_message = I18n.t(:"cancan.default_message", :default => "You are not authorized to access this page.")
+ @default_message = I18n.t(:"unauthorized.default", :default => "You are not authorized to access this page.")
end
def to_s
2  spec/cancan/exceptions_spec.rb
View
@@ -39,7 +39,7 @@
end
it "uses i18n for the default message" do
- I18n.backend.store_translations :en, :cancan => {:default_message => "This is a different message"}
+ I18n.backend.store_translations :en, :unauthorized => {:default => "This is a different message"}
@exception = CanCan::AccessDenied.new
@exception.message.should == "This is a different message"
end
Please sign in to comment.
Something went wrong with that request. Please try again.