simple_group 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +4 -5
- data/lib/simple_group/combination.rb +2 -2
- data/lib/simple_group/group.rb +2 -2
- data/lib/simple_group/version.rb +1 -1
- data/simple_group.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '039af7efa148ef672e9c5b87c8e7e2865cd9df2e'
|
4
|
+
data.tar.gz: 9dcb95fe258f967f878e35ef40e52adb7a787836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7840967ce6c2de3a16b44091b5b15114c787ee835417a2e6511ff8010a2c34cd8678eb4f6220a3ca1b70ced364f5589c7e70d5707ad6632ebf314d105b5f537f
|
7
|
+
data.tar.gz: 9f683ce5bb9f31636c3a89d6a881c803a7189698beeb076104cc3538232058ee58f251a3ac61bbceb40e59e93f5c2368a9805a4846f73fe44d27b7794f543264
|
data/.travis.yml
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
- 2.2.1
|
3
|
+
- 2.2.2
|
4
|
+
- 2.3.3
|
6
5
|
env:
|
7
|
-
- RAILS_VERSION=
|
8
|
-
- RAILS_VERSION=4.2.
|
6
|
+
- RAILS_VERSION=5.0.1
|
7
|
+
- RAILS_VERSION=4.2.7.1
|
9
8
|
- RAILS_VERSION=4.1
|
10
9
|
- RAILS_VERSION=4.0
|
11
10
|
script: bundle exec rspec
|
@@ -11,8 +11,8 @@ module SimpleGroup
|
|
11
11
|
belongs_to :group, polymorphic: true
|
12
12
|
belongs_to :group_item, polymorphic: true
|
13
13
|
|
14
|
-
scope :for_type, lambda { |klass| where(group_item_type: klass) }
|
15
|
-
scope :by_type, lambda { |klass| where(group_type: klass) }
|
14
|
+
scope :for_type, lambda { |klass| where(group_item_type: klass.is_a?(Class) ? klass.name : klass) }
|
15
|
+
scope :by_type, lambda { |klass| where(group_type: klass.is_a?(Class) ? klass.name : klass) }
|
16
16
|
|
17
17
|
validates :group_item, presence: true
|
18
18
|
validates :group, presence: true
|
data/lib/simple_group/group.rb
CHANGED
@@ -28,9 +28,9 @@ module SimpleGroup
|
|
28
28
|
def remove(model)
|
29
29
|
raise_error unless model.class.groupable?
|
30
30
|
group = SimpleGroup::Combination.where(
|
31
|
-
group_type: self.class,
|
31
|
+
group_type: self.class.name,
|
32
32
|
group_id: self,
|
33
|
-
group_item_type: model.class,
|
33
|
+
group_item_type: model.class.name,
|
34
34
|
group_item_id: model
|
35
35
|
).first
|
36
36
|
if group.present?
|
data/lib/simple_group/version.rb
CHANGED
data/simple_group.gemspec
CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "pry"
|
23
23
|
spec.add_development_dependency "rspec", ">= 3.0.0"
|
24
24
|
spec.add_development_dependency "sqlite3"
|
25
|
-
spec.add_development_dependency "database_rewinder",
|
25
|
+
spec.add_development_dependency "database_rewinder", '~> 0.8.0'
|
26
26
|
spec.add_development_dependency 'combustion', '~> 0.5.3'
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_group
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toyoaki Oko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.8.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.8.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: combustion
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.5.2
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: simple_group is able to add group function to ActiveRecord.
|