roles_data_mapper 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.textile ADDED
@@ -0,0 +1,8 @@
1
+ h2. Changelog
2
+
3
+ h3. 20. Dec 2010
4
+
5
+ Added uniqueness validation to Role class to ensure no duplicates of role for :one and :many role strategies
6
+
7
+
8
+
data/Rakefile CHANGED
@@ -9,16 +9,17 @@ begin
9
9
  gem.authors = ["Kristian Mandrup"]
10
10
  gem.add_development_dependency "rspec", ">= 2.0.1"
11
11
 
12
- gem.add_dependency "dm-core", "~> 1.0"
13
- gem.add_dependency "dm-types", "~> 1.0"
14
- gem.add_dependency "dm-migrations", "~> 1.0"
12
+ gem.add_dependency "dm-core", "~> 1.0"
13
+ gem.add_dependency "dm-types", "~> 1.0"
14
+ gem.add_dependency "dm-migrations", "~> 1.0"
15
+ gem.add_dependency "dm-validations", "~> 1.0"
15
16
 
16
- gem.add_dependency "activesupport", ">= 3.0.0"
17
+ gem.add_dependency "activesupport", ">= 3.0.1"
17
18
  gem.add_dependency "require_all", '~> 1.2.0'
18
- gem.add_dependency "sugar-high", '>= 0.3.0'
19
- gem.add_dependency "roles_generic", '>= 0.3.1'
19
+ gem.add_dependency "sugar-high", '>= 0.3.1'
20
+ gem.add_dependency "roles_generic", '>= 0.3.2'
20
21
 
21
- gem.add_dependency 'rails3_artifactor', '>= 0.3.1'
22
+ gem.add_dependency 'rails3_artifactor', '>= 0.3.2'
22
23
  gem.add_dependency 'logging_assist', '>= 0.1.6'
23
24
 
24
25
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -3,8 +3,11 @@ module Roles::Base
3
3
  strategy_class.valid_roles = role_list.to_symbols
4
4
  if role_class_name
5
5
  role_list.each do |name|
6
- role = role_class_name.create(:name => name.to_s)
7
- role.save
6
+ begin
7
+ role = role_class_name.create(:name => name.to_s)
8
+ role.save
9
+ rescue
10
+ end
8
11
  end
9
12
  end
10
13
  end
@@ -16,6 +19,8 @@ class Role
16
19
  property :id, Serial
17
20
  property :name, String
18
21
 
22
+ validates_uniqueness_of :name
23
+
19
24
  class << self
20
25
  def find_roles(*role_names)
21
26
  all(:name => role_names.flatten)
@@ -6,6 +6,7 @@ require 'sugar-high/array'
6
6
  require 'dm-core'
7
7
  require 'dm-types'
8
8
  require 'dm-migrations'
9
+ require 'dm-validations'
9
10
 
10
11
  require 'roles_data_mapper/namespaces'
11
12
  require 'roles_data_mapper/base'
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{roles_data_mapper}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.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"]
12
- s.date = %q{2010-12-01}
12
+ s.date = %q{2010-12-20}
13
13
  s.description = %q{Makes it easy to set a role strategy on your User model in DataMapper}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  ".rspec",
22
+ "Changelog.textile",
22
23
  "LICENSE",
23
24
  "README.markdown",
24
25
  "Rakefile",
@@ -76,22 +77,24 @@ Gem::Specification.new do |s|
76
77
  s.add_runtime_dependency(%q<dm-core>, ["~> 1.0"])
77
78
  s.add_runtime_dependency(%q<dm-types>, ["~> 1.0"])
78
79
  s.add_runtime_dependency(%q<dm-migrations>, ["~> 1.0"])
79
- s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
80
+ s.add_runtime_dependency(%q<dm-validations>, ["~> 1.0"])
81
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.1"])
80
82
  s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
81
- s.add_runtime_dependency(%q<sugar-high>, [">= 0.3.0"])
82
- s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.1"])
83
- s.add_runtime_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
83
+ s.add_runtime_dependency(%q<sugar-high>, [">= 0.3.1"])
84
+ s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.2"])
85
+ s.add_runtime_dependency(%q<rails3_artifactor>, [">= 0.3.2"])
84
86
  s.add_runtime_dependency(%q<logging_assist>, [">= 0.1.6"])
85
87
  else
86
88
  s.add_dependency(%q<rspec>, [">= 2.0.1"])
87
89
  s.add_dependency(%q<dm-core>, ["~> 1.0"])
88
90
  s.add_dependency(%q<dm-types>, ["~> 1.0"])
89
91
  s.add_dependency(%q<dm-migrations>, ["~> 1.0"])
90
- s.add_dependency(%q<activesupport>, [">= 3.0.0"])
92
+ s.add_dependency(%q<dm-validations>, ["~> 1.0"])
93
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
91
94
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
92
- s.add_dependency(%q<sugar-high>, [">= 0.3.0"])
93
- s.add_dependency(%q<roles_generic>, [">= 0.3.1"])
94
- s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
95
+ s.add_dependency(%q<sugar-high>, [">= 0.3.1"])
96
+ s.add_dependency(%q<roles_generic>, [">= 0.3.2"])
97
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.2"])
95
98
  s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
96
99
  end
97
100
  else
@@ -99,11 +102,12 @@ Gem::Specification.new do |s|
99
102
  s.add_dependency(%q<dm-core>, ["~> 1.0"])
100
103
  s.add_dependency(%q<dm-types>, ["~> 1.0"])
101
104
  s.add_dependency(%q<dm-migrations>, ["~> 1.0"])
102
- s.add_dependency(%q<activesupport>, [">= 3.0.0"])
105
+ s.add_dependency(%q<dm-validations>, ["~> 1.0"])
106
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
103
107
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
104
- s.add_dependency(%q<sugar-high>, [">= 0.3.0"])
105
- s.add_dependency(%q<roles_generic>, [">= 0.3.1"])
106
- s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
108
+ s.add_dependency(%q<sugar-high>, [">= 0.3.1"])
109
+ s.add_dependency(%q<roles_generic>, [">= 0.3.2"])
110
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.2"])
107
111
  s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
108
112
  end
109
113
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-01 00:00:00 +01:00
17
+ date: 2010-12-20 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -75,9 +75,23 @@ dependencies:
75
75
  type: :runtime
76
76
  version_requirements: *id004
77
77
  - !ruby/object:Gem::Dependency
78
- name: activesupport
78
+ name: dm-validations
79
79
  prerelease: false
80
80
  requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ segments:
86
+ - 1
87
+ - 0
88
+ version: "1.0"
89
+ type: :runtime
90
+ version_requirements: *id005
91
+ - !ruby/object:Gem::Dependency
92
+ name: activesupport
93
+ prerelease: false
94
+ requirement: &id006 !ruby/object:Gem::Requirement
81
95
  none: false
82
96
  requirements:
83
97
  - - ">="
@@ -85,14 +99,14 @@ dependencies:
85
99
  segments:
86
100
  - 3
87
101
  - 0
88
- - 0
89
- version: 3.0.0
102
+ - 1
103
+ version: 3.0.1
90
104
  type: :runtime
91
- version_requirements: *id005
105
+ version_requirements: *id006
92
106
  - !ruby/object:Gem::Dependency
93
107
  name: require_all
94
108
  prerelease: false
95
- requirement: &id006 !ruby/object:Gem::Requirement
109
+ requirement: &id007 !ruby/object:Gem::Requirement
96
110
  none: false
97
111
  requirements:
98
112
  - - ~>
@@ -103,11 +117,11 @@ dependencies:
103
117
  - 0
104
118
  version: 1.2.0
105
119
  type: :runtime
106
- version_requirements: *id006
120
+ version_requirements: *id007
107
121
  - !ruby/object:Gem::Dependency
108
122
  name: sugar-high
109
123
  prerelease: false
110
- requirement: &id007 !ruby/object:Gem::Requirement
124
+ requirement: &id008 !ruby/object:Gem::Requirement
111
125
  none: false
112
126
  requirements:
113
127
  - - ">="
@@ -115,14 +129,14 @@ dependencies:
115
129
  segments:
116
130
  - 0
117
131
  - 3
118
- - 0
119
- version: 0.3.0
132
+ - 1
133
+ version: 0.3.1
120
134
  type: :runtime
121
- version_requirements: *id007
135
+ version_requirements: *id008
122
136
  - !ruby/object:Gem::Dependency
123
137
  name: roles_generic
124
138
  prerelease: false
125
- requirement: &id008 !ruby/object:Gem::Requirement
139
+ requirement: &id009 !ruby/object:Gem::Requirement
126
140
  none: false
127
141
  requirements:
128
142
  - - ">="
@@ -130,14 +144,14 @@ dependencies:
130
144
  segments:
131
145
  - 0
132
146
  - 3
133
- - 1
134
- version: 0.3.1
147
+ - 2
148
+ version: 0.3.2
135
149
  type: :runtime
136
- version_requirements: *id008
150
+ version_requirements: *id009
137
151
  - !ruby/object:Gem::Dependency
138
152
  name: rails3_artifactor
139
153
  prerelease: false
140
- requirement: &id009 !ruby/object:Gem::Requirement
154
+ requirement: &id010 !ruby/object:Gem::Requirement
141
155
  none: false
142
156
  requirements:
143
157
  - - ">="
@@ -145,14 +159,14 @@ dependencies:
145
159
  segments:
146
160
  - 0
147
161
  - 3
148
- - 1
149
- version: 0.3.1
162
+ - 2
163
+ version: 0.3.2
150
164
  type: :runtime
151
- version_requirements: *id009
165
+ version_requirements: *id010
152
166
  - !ruby/object:Gem::Dependency
153
167
  name: logging_assist
154
168
  prerelease: false
155
- requirement: &id010 !ruby/object:Gem::Requirement
169
+ requirement: &id011 !ruby/object:Gem::Requirement
156
170
  none: false
157
171
  requirements:
158
172
  - - ">="
@@ -163,7 +177,7 @@ dependencies:
163
177
  - 6
164
178
  version: 0.1.6
165
179
  type: :runtime
166
- version_requirements: *id010
180
+ version_requirements: *id011
167
181
  description: Makes it easy to set a role strategy on your User model in DataMapper
168
182
  email: kmandrup@gmail.com
169
183
  executables: []
@@ -176,6 +190,7 @@ extra_rdoc_files:
176
190
  files:
177
191
  - .document
178
192
  - .rspec
193
+ - Changelog.textile
179
194
  - LICENSE
180
195
  - README.markdown
181
196
  - Rakefile