devise_roles 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79a3613be0a729ab293304a632bde8c20038f0ec
4
- data.tar.gz: 25b92ad23f1058cfd11f4d1cf0868dca1fd1baff
3
+ metadata.gz: a309914879b26ba2c286b2a9ae118deb3db8ef38
4
+ data.tar.gz: af68bdfae1016d0b727bb7dd203a206ca07b5ec9
5
5
  SHA512:
6
- metadata.gz: 9bb000ad737400805596a7e6bba88072bf27f4ecba5d67134575559cbbd4f79229d903388257feea505292bca5aa906d51a47fd451d0f2754d1b1e5a8c2f2710
7
- data.tar.gz: cd78fb076ab6d0755da5eb433bc9d404d8be519e42100a29029c03c309707948c72ddae080b558714f4c97ede756f0291fa7824ffa3e164deb1b2f094e6c502b
6
+ metadata.gz: 6c21103b89bb4585e015a215f2f7f48a5dad502c086ccd1c26b7fc436e7d1cfd3f8dccc92e12c25890fb2473d2c465879fe4e9e9acc907fe00a069346255c4dd
7
+ data.tar.gz: 8202f10944ece07db11430c6f0d0e59d066b69e7eefee56432234cc8ebb6c6d7b3983be68ecf48d2e06111f87608ef0da1d3cb5db8865ee11d63dfef8c1284d9
data/README.md CHANGED
@@ -75,14 +75,14 @@ Now you can go to learn methods for this *gem*.
75
75
 
76
76
  If you want to enable some page for exact Role only, use this method
77
77
  ```ruby
78
- available_for_user_role(user_role_name, user_redirect_path)
78
+ DeviseRoles.available_for_user_role(user_role_name, user_redirect_path)
79
79
  ```
80
80
  Here is some example how to use it
81
81
  ```ruby
82
82
  def some_controller_method_name
83
83
  # Implement it at the top
84
84
  # In this example, current view would be available for admins only
85
- available_for_user_role('admin', root_path)
85
+ DeviseRoles.available_for_user_role('admin', root_path)
86
86
 
87
87
  # Some other code ...
88
88
  # That would be run if user is not **admin**
@@ -1,3 +1,3 @@
1
1
  module DeviseRoles
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/devise_roles.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "devise_roles/version"
2
2
 
3
- class DeviseRoles
3
+ module DeviseRoles
4
4
  def available_for_user_role(user_role_name, user_redirect_path)
5
5
  if current_user.role.name != user_role_name
6
6
  redirect_to admin_path, alert: "You should be #{user_role_name} to view that page!"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_roles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MarkusBansky