mongoid_sortable_relation 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid_sortable_relation/version.rb +1 -1
- data/spec/models/many_to_many_spec.rb +4 -4
- data/spec/models/one_to_many_spec.rb +4 -4
- data/spec/models/origin_optional_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -5
- metadata +7 -13
- data/spec/factories/post.rb +0 -7
- data/spec/factories/tag.rb +0 -8
- data/spec/factories/user.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 398e7eba3749decb72a3ecdd00fd59f685314a15
|
4
|
+
data.tar.gz: 9d1b6cb9d3367af1f6de1997a7b45933d9dbbdc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98ea75732303f23be81998167c529a0b54607d289f284c08357e93f0291338897259b560a1be3a0bf07b00be54204bf25ede4f5d04a46666ee8a86f6b836979f
|
7
|
+
data.tar.gz: 82e69ec660495f1a07a098ecf83ac21ad6a8ded781a49c22192d38f5aa904561daf48c24276473b724484d562a831fa186560dd41b2bf8dd1cc8938ea06be896
|
@@ -3,15 +3,15 @@ require 'spec_helper'
|
|
3
3
|
describe 'Many to many sortable relation' do
|
4
4
|
|
5
5
|
let(:post) do
|
6
|
-
|
6
|
+
Post.create
|
7
7
|
end
|
8
8
|
|
9
9
|
describe 'get relations' do
|
10
10
|
|
11
11
|
let!(:tags) do
|
12
|
-
tag1 =
|
13
|
-
tag2 =
|
14
|
-
tag3 =
|
12
|
+
tag1 = Tag.create :name => 'Name1'
|
13
|
+
tag2 = Tag.create :name => 'Name2'
|
14
|
+
tag3 = Tag.create :name => 'Name3'
|
15
15
|
post.tags = [tag2, tag1, tag3]
|
16
16
|
post.save
|
17
17
|
end
|
@@ -3,15 +3,15 @@ require 'spec_helper'
|
|
3
3
|
describe 'One to many sortable relation' do
|
4
4
|
|
5
5
|
let(:user) do
|
6
|
-
|
6
|
+
User.create
|
7
7
|
end
|
8
8
|
|
9
9
|
describe 'get relations' do
|
10
10
|
|
11
11
|
let!(:posts) do
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
Post.create :user => user, :title => 'Title1', :user_position => 2
|
13
|
+
Post.create :user => user, :title => 'Title2', :user_position => 1
|
14
|
+
Post.create :user => user, :title => 'Title3', :user_position => 3
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'returns ordered relations' do
|
@@ -5,9 +5,9 @@ describe Origin::Optional do
|
|
5
5
|
describe '#prepend_order_by' do
|
6
6
|
|
7
7
|
let!(:users) do
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
User.create :name => 'Name1', :age => 2
|
9
|
+
User.create :name => 'Name2', :age => 1
|
10
|
+
User.create :name => 'Name3', :age => 2
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'adds order' do
|
data/spec/spec_helper.rb
CHANGED
@@ -5,10 +5,8 @@ MODELS = File.join(File.dirname(__FILE__), 'app/models')
|
|
5
5
|
$LOAD_PATH.unshift(MODELS)
|
6
6
|
|
7
7
|
require 'mongoid_sortable_relation'
|
8
|
-
require 'action_controller'
|
9
8
|
require 'rspec'
|
10
9
|
require 'database_cleaner'
|
11
|
-
require 'factory_girl_rails'
|
12
10
|
|
13
11
|
ENV['MONGOID_SPEC_HOST'] ||= 'localhost'
|
14
12
|
ENV['MONGOID_SPEC_PORT'] ||= '27017'
|
@@ -25,9 +23,6 @@ CONFIG = {
|
|
25
23
|
}
|
26
24
|
}
|
27
25
|
|
28
|
-
FactoryGirl.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
|
29
|
-
FactoryGirl.reload
|
30
|
-
|
31
26
|
Mongoid.configure do |config|
|
32
27
|
config.load_configuration(CONFIG)
|
33
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_sortable_relation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Melanitskiy
|
@@ -14,28 +14,28 @@ dependencies:
|
|
14
14
|
name: mongoid
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mongoid_criteria_filter
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: It adds possibility for sorting relation
|
@@ -58,9 +58,6 @@ files:
|
|
58
58
|
- spec/app/models/post.rb
|
59
59
|
- spec/app/models/tag.rb
|
60
60
|
- spec/app/models/user.rb
|
61
|
-
- spec/factories/post.rb
|
62
|
-
- spec/factories/tag.rb
|
63
|
-
- spec/factories/user.rb
|
64
61
|
- spec/models/many_to_many_spec.rb
|
65
62
|
- spec/models/metadata_spec.rb
|
66
63
|
- spec/models/one_to_many_spec.rb
|
@@ -76,12 +73,12 @@ require_paths:
|
|
76
73
|
- lib
|
77
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
78
75
|
requirements:
|
79
|
-
- -
|
76
|
+
- - '>='
|
80
77
|
- !ruby/object:Gem::Version
|
81
78
|
version: '0'
|
82
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
80
|
requirements:
|
84
|
-
- -
|
81
|
+
- - '>='
|
85
82
|
- !ruby/object:Gem::Version
|
86
83
|
version: '0'
|
87
84
|
requirements: []
|
@@ -96,9 +93,6 @@ test_files:
|
|
96
93
|
- spec/models/many_to_many_spec.rb
|
97
94
|
- spec/models/one_to_many_spec.rb
|
98
95
|
- spec/spec_helper.rb
|
99
|
-
- spec/factories/post.rb
|
100
|
-
- spec/factories/user.rb
|
101
|
-
- spec/factories/tag.rb
|
102
96
|
- spec/app/models/post.rb
|
103
97
|
- spec/app/models/user.rb
|
104
98
|
- spec/app/models/tag.rb
|
data/spec/factories/post.rb
DELETED
data/spec/factories/tag.rb
DELETED