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 CHANGED
@@ -1,5 +1,6 @@
1
1
  pkg/*
2
2
  .rvmrc
3
+ .DS_Store
3
4
  bin/
4
5
  tmp/
5
6
  Gemfile.lock
@@ -1,7 +1,6 @@
1
1
  rvm:
2
- - 1.9.2
3
2
  - 1.9.3
3
+ - 2.0.0
4
4
  gemfile:
5
- - ci/Gemfile-3.0
6
- - ci/Gemfile-3.1
7
5
  - ci/Gemfile-3.2
6
+ - ci/Gemfile-4.0
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ == 1.3.0 (2013.08.05)
2
+
3
+ * Rails 4 support
4
+ * removes support for Rails 3.0, Rails 3.1
5
+ * removes support for Ruby 1.9.2
6
+
1
7
  == 1.2.2 (2013.03.08)
2
8
 
3
9
  * Use rdoc/task instead of obsolete rake/rdoctask
@@ -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
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
  gem 'sqlite3'
3
3
  gem 'rake', '>= 0.8.7'
4
4
  gem 'activerecord', '~> 3.2.0'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+ gem 'sqlite3'
3
+ gem 'rake', '>= 0.8.7'
4
+ gem 'activerecord', '~> 4.0.0'
5
+ gem 'railties', '~> 4.0.0'
@@ -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, :roleable_type, :role
5
+ validates_presence_of :roleable, :role
6
6
  end
@@ -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.find_or_create_by_name(rolename.to_s)
38
+ self.roles << Role.where(:name => rolename.to_s).first_or_create
39
39
  end
40
40
 
41
41
  def remove_role(name)
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.version = "1.2.2"
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', '< 4.0')
17
- s.add_dependency('railties', '>= 3.0', '< 4.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.2.2
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-03-08 00:00:00.000000000 Z
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.25
128
+ rubygems_version: 1.8.23
142
129
  signing_key:
143
130
  specification_version: 3
144
131
  summary: Simple roles for ActiveRecord
@@ -1,5 +0,0 @@
1
- source :rubygems
2
- gem 'sqlite3'
3
- gem 'rake', '>= 0.8.7'
4
- gem 'activerecord', '~> 3.0.0'
5
- gem 'railties', '~> 3.0.0'
@@ -1,5 +0,0 @@
1
- source :rubygems
2
- gem 'sqlite3'
3
- gem 'rake', '>= 0.8.7'
4
- gem 'activerecord', '~> 3.1.0'
5
- gem 'railties', '~> 3.1.0'