social_stream-base 0.9.29 → 0.9.30

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,10 +25,6 @@ module SocialStream
25
25
  end
26
26
  end
27
27
 
28
- initializer "social_stream-base.cancan_devise_integration" do
29
- ApplicationController.rescue_handlers += [["CanCan::AccessDenied", :rescue_from_access_denied]]
30
- end
31
-
32
28
  initializer "social_stream-base.toolbar_config" do
33
29
  SocialStream::ToolbarConfig.module_eval do
34
30
  include SocialStream::ToolbarConfig::Base
@@ -52,6 +48,10 @@ module SocialStream
52
48
  config.email_method = :mailboxer_email
53
49
  end
54
50
  end
51
+
52
+ config.to_prepare do
53
+ ApplicationController.rescue_handlers += [["CanCan::AccessDenied", :rescue_from_access_denied]]
54
+ end
55
55
  end
56
56
  end
57
57
  end
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Base
3
- VERSION = "0.9.29".freeze
3
+ VERSION = "0.9.30".freeze
4
4
  end
5
5
  end
@@ -10,8 +10,10 @@ module SocialStream
10
10
 
11
11
  # Redirect to login if the user is trying to access a protected resource
12
12
  # and she is not authenticated
13
- def rescue_from_access_denied
14
- unless user_signed_in?
13
+ def rescue_from_access_denied(exception)
14
+ if user_signed_in?
15
+ raise exception
16
+ else
15
17
  redirect_to new_user_session_path
16
18
  end
17
19
  end
@@ -41,9 +41,7 @@ describe UsersController do
41
41
  begin
42
42
  get :edit, :id => Factory(:user).to_param
43
43
 
44
- assert false
45
- rescue CanCan::AccessDenied
46
- assert true
44
+ response.should redirect_to(:new_user_session)
47
45
  end
48
46
  end
49
47
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-base
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 29
10
- version: 0.9.29
9
+ - 30
10
+ version: 0.9.30
11
11
  platform: ruby
12
12
  authors:
13
13
  - GING - DIT - UPM