From 1c3e61725f4e88e14271304f47bec129a13c7c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Hock=20Isaza?= Date: Fri, 1 Jul 2011 13:10:20 -0500 Subject: [PATCH] Change the i18n default name to :"unauthorized.default" --- lib/cancan/exceptions.rb | 2 +- spec/cancan/exceptions_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cancan/exceptions.rb b/lib/cancan/exceptions.rb index ab44f94..e055e5e 100644 --- a/lib/cancan/exceptions.rb +++ b/lib/cancan/exceptions.rb @@ -40,7 +40,7 @@ module CanCan @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 diff --git a/spec/cancan/exceptions_spec.rb b/spec/cancan/exceptions_spec.rb index f646ff5..62e4360 100644 --- a/spec/cancan/exceptions_spec.rb +++ b/spec/cancan/exceptions_spec.rb @@ -39,7 +39,7 @@ describe CanCan::AccessDenied do 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