role_play 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +2 -3
- data/CHANGELOG +6 -0
- data/README.markdown +2 -0
- data/ci/Gemfile-3.2 +1 -1
- data/ci/Gemfile-4.0 +5 -0
- data/lib/role_assignment.rb +1 -1
- data/lib/role_play.rb +1 -1
- data/role_play.gemspec +3 -3
- metadata +4 -17
- data/ci/Gemfile-3.0 +0 -5
- data/ci/Gemfile-3.1 +0 -5
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
@@ -35,4 +35,6 @@ Now your model has these instance methods:
|
|
35
35
|
Tested in Ruby 1.9 and Rails 3.x on Travis CI:
|
36
36
|
<http://travis-ci.org/mintdigital/role_play>
|
37
37
|
|
38
|
+
[![Build Status](https://travis-ci.org/mintdigital/role_play.png)](https://travis-ci.org/mintdigital/role_play)
|
39
|
+
|
38
40
|
Copyright (c) 2008 Mint Digital, released under the MIT license
|
data/ci/Gemfile-3.2
CHANGED
data/ci/Gemfile-4.0
ADDED
data/lib/role_assignment.rb
CHANGED
@@ -2,5 +2,5 @@ class RoleAssignment < ActiveRecord::Base
|
|
2
2
|
belongs_to :roleable, :polymorphic => true
|
3
3
|
belongs_to :role
|
4
4
|
validates_uniqueness_of :role_id, :scope => [:roleable_id, :roleable_type]
|
5
|
-
validates_presence_of :roleable, :
|
5
|
+
validates_presence_of :roleable, :role
|
6
6
|
end
|
data/lib/role_play.rb
CHANGED
@@ -35,7 +35,7 @@ module RolePlay
|
|
35
35
|
def add_role(rolename)
|
36
36
|
return false unless can_have_role?(rolename)
|
37
37
|
return true if has_role?(rolename)
|
38
|
-
self.roles << Role.
|
38
|
+
self.roles << Role.where(:name => rolename.to_s).first_or_create
|
39
39
|
end
|
40
40
|
|
41
41
|
def remove_role(name)
|
data/role_play.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.version = "1.
|
4
|
+
s.version = "1.3.0"
|
5
5
|
|
6
6
|
s.name = 'role_play'
|
7
7
|
s.summary = %q{Simple roles for ActiveRecord}
|
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
14
14
|
s.require_paths = ["lib"]
|
15
15
|
s.platform = Gem::Platform::RUBY
|
16
|
-
s.add_dependency('activerecord', '>= 3.0'
|
17
|
-
s.add_dependency('railties', '>= 3.0'
|
16
|
+
s.add_dependency('activerecord', '>= 3.0')
|
17
|
+
s.add_dependency('railties', '>= 3.0')
|
18
18
|
s.add_development_dependency('rake', '>= 0.8.7')
|
19
19
|
s.add_development_dependency('sqlite3')
|
20
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: role_play
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -19,9 +19,6 @@ dependencies:
|
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '3.0'
|
22
|
-
- - <
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: '4.0'
|
25
22
|
type: :runtime
|
26
23
|
prerelease: false
|
27
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,9 +27,6 @@ dependencies:
|
|
30
27
|
- - ! '>='
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: '3.0'
|
33
|
-
- - <
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '4.0'
|
36
30
|
- !ruby/object:Gem::Dependency
|
37
31
|
name: railties
|
38
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -41,9 +35,6 @@ dependencies:
|
|
41
35
|
- - ! '>='
|
42
36
|
- !ruby/object:Gem::Version
|
43
37
|
version: '3.0'
|
44
|
-
- - <
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '4.0'
|
47
38
|
type: :runtime
|
48
39
|
prerelease: false
|
49
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,9 +43,6 @@ dependencies:
|
|
52
43
|
- - ! '>='
|
53
44
|
- !ruby/object:Gem::Version
|
54
45
|
version: '3.0'
|
55
|
-
- - <
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: '4.0'
|
58
46
|
- !ruby/object:Gem::Dependency
|
59
47
|
name: rake
|
60
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,9 +88,8 @@ files:
|
|
100
88
|
- MIT-LICENSE
|
101
89
|
- README.markdown
|
102
90
|
- Rakefile
|
103
|
-
- ci/Gemfile-3.0
|
104
|
-
- ci/Gemfile-3.1
|
105
91
|
- ci/Gemfile-3.2
|
92
|
+
- ci/Gemfile-4.0
|
106
93
|
- install.rb
|
107
94
|
- lib/generators/role_play_migration/USAGE
|
108
95
|
- lib/generators/role_play_migration/role_play_migration_generator.rb
|
@@ -138,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
125
|
version: '0'
|
139
126
|
requirements: []
|
140
127
|
rubyforge_project:
|
141
|
-
rubygems_version: 1.8.
|
128
|
+
rubygems_version: 1.8.23
|
142
129
|
signing_key:
|
143
130
|
specification_version: 3
|
144
131
|
summary: Simple roles for ActiveRecord
|
data/ci/Gemfile-3.0
DELETED