devise_russian 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,10 +53,6 @@ class AuthenticationsController < DeviseController
53
53
 
54
54
  protected
55
55
 
56
- def authenticate_user!
57
- permission_denied if current_user.nil?
58
- end
59
-
60
56
  # This is necessary since Rails 3.0.4
61
57
  # See https://github.com/intridea/omniauth/issues/185
62
58
  # and http://www.arailsdemo.com/posts/44
@@ -0,0 +1,15 @@
1
+ # coding: utf-8
2
+ module DeviseRussian
3
+ module Controllers
4
+ module Base
5
+ def authenticate_user!
6
+ permission_denied if current_user.nil?
7
+ end
8
+
9
+ def permission_denied
10
+ flash[:error] = I18n.t(:permission_denied)
11
+ redirect_to devise_russian.new_user_session_url
12
+ end
13
+ end
14
+ end
15
+ end
@@ -4,6 +4,7 @@ module DeviseRussian
4
4
  engine_name "devise_russian"
5
5
 
6
6
  initializer "devise_russian.includers" do |app|
7
+ ActionController::Base.send :include, DeviseRussian::Controllers::Base
7
8
  ActiveRecord::Base.send :include, DeviseRussian::Models::Base
8
9
  end
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseRussian
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  # coding: utf-8
2
2
  require "devise"
3
+ require "devise_russian/controllers/base"
3
4
  require "devise_russian/models/base"
4
5
  require "devise_russian/engine"
5
6
  require "devise_russian/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_russian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -212,6 +212,7 @@ files:
212
212
  - config/routes.rb
213
213
  - devise_russian.gemspec
214
214
  - lib/devise_russian.rb
215
+ - lib/devise_russian/controllers/base.rb
215
216
  - lib/devise_russian/engine.rb
216
217
  - lib/devise_russian/models/base.rb
217
218
  - lib/devise_russian/version.rb