glebtv-mongoid_nested_set 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a70a276e026aa9628097146cba3c42172a0c0e82e6d47627b8a0673c144f930c
4
- data.tar.gz: 84c6ccac7e7986494dcc9df517409347c796867315a3ee754d290ea3cd9ea6d5
3
+ metadata.gz: b0150a61bd3085508ba1b90a5fdf1e60f7d0191bd4e2866940bca21e2941d934
4
+ data.tar.gz: 11b348f417467e3a7676e95c9952d17af654eb45754e61dadc1d316176f7c450
5
5
  SHA512:
6
- metadata.gz: 36abfcd798bbc5cf7b64fa5a2a20f6495bca4e91c6033cd8299045219ab69d8949c1f669f9444ccdabbb0de7537f9b59748a86cfec0cd3ea443a06b441867bc7
7
- data.tar.gz: 9e581d3387d5bbcf902964ed4b7720fc0168ddb57ac2bf614a39e70ca990ef4939a81b5b0359c90bcd0d317218e2f75abec944a1cfa6406bedb0f0595eba9257
6
+ metadata.gz: acc1a4b357b3d906787b7d98fd8dbd8cd2411d500559e6bba2ada1e68960bf7649af3e635f9169b2e57a466442fdafe75a5aa9d943aad89d624b02fd1527df73
7
+ data.tar.gz: 5039c5e8d5f4998e45b268f0ca713e15cb5b59dca3bf0c8f3d9a0a326a922542a6121ed9eab35b257f1cf189b0c4f5aea66da2d9720560d78b013a3cd3bf34a9
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p353
1
+ 3.3.1
data/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'mongoid-rspec', github: "mongoid/mongoid-rspec"
4
-
5
3
  # Specify your gem's dependencies in glebtv-mongoid_nested_set.gemspec
6
4
  gemspec
data/README.markdown CHANGED
@@ -3,11 +3,10 @@ Mongoid Nested Set
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/glebtv-mongoid_nested_set.png)](http://badge.fury.io/rb/glebtv-mongoid_nested_set)
5
5
  [![Build Status](https://travis-ci.org/glebtv/mongoid_nested_set.png?branch=master)](https://travis-ci.org/glebtv/mongoid_nested_set)
6
- [![Dependency Status](https://gemnasium.com/glebtv/mongoid_nested_set.png)](https://gemnasium.com/glebtv/mongoid_nested_set)
7
6
 
8
7
  Mongoid Nested Set is an implementation of the nested set pattern for Mongoid.
9
8
  It is a port of [AwesomeNestedSet for ActiveRecord](https://github.com/galetahub/awesome_nested_set).
10
- It supports Mongoid 3/4 and Rails 3/4.
9
+ It supports Mongoid 4+ and Rails 4+
11
10
 
12
11
  Nested Set represents hierarchies of trees in MongoDB using references rather
13
12
  than embedded documents. A tree is stored as a flat list of documents in a
@@ -26,7 +25,7 @@ Install as Gem
26
25
 
27
26
  via Gemfile
28
27
 
29
- gem 'glebtv-mongoid_nested_set', '~> 0.4.2'
28
+ gem 'glebtv-mongoid_nested_set', '~> 0.7.0'
30
29
 
31
30
 
32
31
  ## Usage
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_runtime_dependency 'mongoid', [">= 6.0", "< 8.0"]
22
+ s.add_runtime_dependency 'mongoid', [">= 6.0", "< 9.0"]
23
23
 
24
24
  s.add_development_dependency 'rake'
25
25
  s.add_development_dependency 'rspec'
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.add_development_dependency 'simplecov'
28
28
  s.add_development_dependency 'simplecov-rcov'
29
29
  s.add_development_dependency 'database_cleaner'
30
+ s.add_development_dependency 'database_cleaner-mongoid'
30
31
  s.add_development_dependency 'rspec-expectations'
31
32
  s.add_development_dependency 'mongoid-rspec'
32
33
  end
@@ -220,7 +220,12 @@ module Mongoid::Acts::NestedSet
220
220
  conditions = scopes.inject({}) do |conditions,attr|
221
221
  conditions.merge attr => self[attr]
222
222
  end unless scopes.empty?
223
- scope_class.criteria.where(conditions).asc(left_field_name)
223
+
224
+ if conditions.nil?
225
+ scope_class.criteria.asc(left_field_name)
226
+ else
227
+ scope_class.criteria.where(conditions).asc(left_field_name)
228
+ end
224
229
  end
225
230
 
226
231
 
@@ -1,3 +1,3 @@
1
1
  module MongoidNestedSet
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
data/spec/mongoid.yml CHANGED
@@ -3,5 +3,9 @@ test:
3
3
  default:
4
4
  database: mongoid_nested_set_test
5
5
  hosts:
6
- - localhost:27017
6
+ - localhost:27018
7
+ options:
8
+ user: 'admin'
9
+ password: 'rs123456'
10
+ auth_source: admin
7
11
 
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  require 'rspec'
4
4
  require 'database_cleaner'
5
+ require 'database_cleaner-mongoid'
5
6
  require 'active_support'
6
7
  require 'active_support/deprecation'
7
8
  require 'mongoid'
@@ -36,12 +37,11 @@ RSpec.configure do |config|
36
37
  #config.expect_with(:rspec) { |c| c.syntax = :should }
37
38
 
38
39
  config.before(:suite) do
39
- DatabaseCleaner[:mongoid, {client: :default }]
40
- DatabaseCleaner[:mongoid].strategy = :truncation
40
+ DatabaseCleaner[:mongoid].strategy = :deletion
41
41
  end
42
42
 
43
43
  config.before(:each) do
44
- DatabaseCleaner.clean
44
+ DatabaseCleaner[:mongoid].clean
45
45
  end
46
46
 
47
47
  config.include(Mongoid::Acts::NestedSet::Matchers)
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glebtv-mongoid_nested_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GlebTV
8
8
  - Brandon Turner
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-26 00:00:00.000000000 Z
12
+ date: 2024-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '6.0'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '8.0'
23
+ version: '9.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '6.0'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '8.0'
33
+ version: '9.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +115,20 @@ dependencies:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
+ - !ruby/object:Gem::Dependency
119
+ name: database_cleaner-mongoid
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
118
132
  - !ruby/object:Gem::Dependency
119
133
  name: rspec-expectations
120
134
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +208,7 @@ homepage: http://github.com/glebtv/mongoid_nested_set
194
208
  licenses:
195
209
  - MIT
196
210
  metadata: {}
197
- post_install_message:
211
+ post_install_message:
198
212
  rdoc_options: []
199
213
  require_paths:
200
214
  - lib
@@ -209,9 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
223
  - !ruby/object:Gem::Version
210
224
  version: '0'
211
225
  requirements: []
212
- rubyforge_project: mongoid_nested_set
213
- rubygems_version: 2.7.7
214
- signing_key:
226
+ rubygems_version: 3.5.9
227
+ signing_key:
215
228
  specification_version: 4
216
229
  summary: Nested set based tree implementation for Mongoid
217
230
  test_files: