mongoid_sortable_relation 0.0.2 → 0.0.3
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.rb +11 -7
- data/lib/mongoid_sortable_relation/{many.rb → many/builder.rb} +0 -0
- data/lib/mongoid_sortable_relation/{findable.rb → many/findable.rb} +0 -0
- data/lib/mongoid_sortable_relation/{macros.rb → many/macros.rb} +1 -1
- data/lib/mongoid_sortable_relation/{origin_optional.rb → many/origin_optional.rb} +0 -0
- data/lib/mongoid_sortable_relation/{referenced/many.rb → many/referenced.rb} +0 -0
- data/lib/mongoid_sortable_relation/{many_to_many.rb → many_to_many/builder.rb} +0 -0
- data/lib/mongoid_sortable_relation/{referenced/many_to_many.rb → many_to_many/referenced.rb} +0 -0
- data/lib/mongoid_sortable_relation/version.rb +4 -0
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5312af9141d4bac176074e424c83d3a5a1a4bfcd
|
4
|
+
data.tar.gz: c72b73b46b2ac74417671aa1c2bcece9507f66f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3396d635e7279f419ba7f84b31f6959ee237bb37b3b6250aab0c2f961fe76db7bb0c0a076d24df6a9815987289ac36ab508aece191965298eb56decdbd02028d
|
7
|
+
data.tar.gz: 1e4bf22e53ba33efc9e59a007e0875288e46beca77f2eac9aeb6218b92674a76a14e7f02231b298b6e3a3e1239f06bfad4cd6a2550cd8c6a70a3b8931bfde255
|
@@ -2,14 +2,18 @@ require 'rails'
|
|
2
2
|
require 'mongoid'
|
3
3
|
require 'mongoid_criteria_filter'
|
4
4
|
|
5
|
-
|
6
|
-
require 'mongoid_sortable_relation/referenced
|
7
|
-
require 'mongoid_sortable_relation/findable'
|
8
|
-
require 'mongoid_sortable_relation/macros'
|
9
|
-
require 'mongoid_sortable_relation/many'
|
10
|
-
require 'mongoid_sortable_relation/
|
5
|
+
# many
|
6
|
+
require 'mongoid_sortable_relation/many/referenced'
|
7
|
+
require 'mongoid_sortable_relation/many/findable'
|
8
|
+
require 'mongoid_sortable_relation/many/macros'
|
9
|
+
require 'mongoid_sortable_relation/many/builder'
|
10
|
+
require 'mongoid_sortable_relation/many/origin_optional'
|
11
|
+
|
12
|
+
# many to many
|
13
|
+
require 'mongoid_sortable_relation/many_to_many/referenced'
|
14
|
+
require 'mongoid_sortable_relation/many_to_many/builder'
|
15
|
+
|
11
16
|
require 'mongoid_sortable_relation/metadata'
|
12
|
-
require 'mongoid_sortable_relation/origin_optional'
|
13
17
|
|
14
18
|
module MongoidSortableRelation
|
15
19
|
|
File without changes
|
File without changes
|
@@ -10,7 +10,7 @@ module Mongoid
|
|
10
10
|
|
11
11
|
def reference(metadata, type = Object)
|
12
12
|
original_reference(metadata, type)
|
13
|
-
if metadata.sortable?
|
13
|
+
if metadata.sortable? and metadata.relation == Mongoid::Relations::Referenced::Many
|
14
14
|
to_class = metadata.class_name.classify.constantize
|
15
15
|
to_class.field metadata.sortable_field, :type => Integer
|
16
16
|
to_class.scope metadata.sortable_scope, -> { prepend_order_by(metadata.sortable_field => :asc) }
|
File without changes
|
File without changes
|
File without changes
|
data/lib/mongoid_sortable_relation/{referenced/many_to_many.rb → many_to_many/referenced.rb}
RENAMED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Melanitskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -60,14 +60,15 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- lib/mongoid_sortable_relation.rb
|
63
|
-
- lib/mongoid_sortable_relation/
|
64
|
-
- lib/mongoid_sortable_relation/
|
65
|
-
- lib/mongoid_sortable_relation/many.rb
|
66
|
-
- lib/mongoid_sortable_relation/
|
63
|
+
- lib/mongoid_sortable_relation/many/builder.rb
|
64
|
+
- lib/mongoid_sortable_relation/many/findable.rb
|
65
|
+
- lib/mongoid_sortable_relation/many/macros.rb
|
66
|
+
- lib/mongoid_sortable_relation/many/origin_optional.rb
|
67
|
+
- lib/mongoid_sortable_relation/many/referenced.rb
|
68
|
+
- lib/mongoid_sortable_relation/many_to_many/builder.rb
|
69
|
+
- lib/mongoid_sortable_relation/many_to_many/referenced.rb
|
67
70
|
- lib/mongoid_sortable_relation/metadata.rb
|
68
|
-
- lib/mongoid_sortable_relation/
|
69
|
-
- lib/mongoid_sortable_relation/referenced/many.rb
|
70
|
-
- lib/mongoid_sortable_relation/referenced/many_to_many.rb
|
71
|
+
- lib/mongoid_sortable_relation/version.rb
|
71
72
|
homepage: https://github.com/Rademade/mongoid_sortable_relation
|
72
73
|
licenses:
|
73
74
|
- MIT
|