roles_active_record 0.4.6.1 → 0.4.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.6.1
1
+ 0.4.6.2
@@ -81,12 +81,19 @@ module Roles::ActiveRecord
81
81
  end
82
82
 
83
83
  def default_role_class strategy_name
84
- if defined? ::Role
85
- require "roles_active_record/#{strategy_name}"
86
- return ::Role
87
- end
88
- puts "Default Role class not yet defined" if Roles::ActiveRecord.warnings_on
89
- 'Role'
84
+ require "roles_active_record/#{strategy_name}"
85
+ # if !defined? ::Role
86
+ # require "roles_active_record/#{strategy_name}"
87
+ # puts "Using default Role classes since they have not yet been defined" # if Roles::ActiveRecord.warnings_on
88
+ # return ::Role
89
+ # end
90
+ # if defined? ::Role
91
+ #
92
+ # puts "Role is defined"
93
+ # return ::Role
94
+ # end
95
+ # puts "Late binding!!!"
96
+ ::Role
90
97
  end
91
98
 
92
99
  def get_role_class strategy_name, options
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{roles_active_record}
8
- s.version = "0.4.6.1"
8
+ s.version = "0.4.6.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
@@ -76,7 +76,7 @@ describe "Roles for Active Record: #{api_name}" do
76
76
  it "should be true that the User class has a valid role of :guest" do
77
77
  User.valid_roles?(:guest, :admin).should be_true
78
78
  end
79
- end
79
+ end
80
80
 
81
81
  describe '#has_role?' do
82
82
  it "should have admin user role to :admin and not to :user" do
@@ -176,7 +176,7 @@ describe "Roles for Active Record: #{api_name}" do
176
176
  @guest_user.roles = :guest
177
177
  end
178
178
  end
179
-
179
+
180
180
  describe '#role=' do
181
181
  it "should set user role to :admin" do
182
182
  @guest_user.role = :admin
@@ -191,7 +191,7 @@ describe "Roles for Active Record: #{api_name}" do
191
191
  u.has_role?(:admin).should be_true
192
192
  end
193
193
  end
194
-
194
+
195
195
 
196
196
  describe '#exchange_roles' do
197
197
  it "should exchange user role :user with role :admin" do
@@ -225,5 +225,5 @@ describe "Roles for Active Record: #{api_name}" do
225
225
  @guest_user.remove_role :admin
226
226
  @guest_user.has_role?(:admin).should_not be_true
227
227
  end
228
- end
228
+ end
229
229
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 4
8
8
  - 6
9
- - 1
10
- version: 0.4.6.1
9
+ - 2
10
+ version: 0.4.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kristian Mandrup