mongoid-dsl 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/VERSION +1 -1
- data/lib/mongoid-dsl/monkey.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d37b0c5bd20a3683ae4c76517067425243b05167
|
4
|
+
data.tar.gz: a4daa266cce7305dc49cbe06d8e2b58ae18955b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f40b0a3a3e312ea6826548c6aa0f60f5b91075101672c199014122efcadca90c8b3c4f3b91625781a85003a7fad724bf89097dd75db0665e10b8a7548554f54
|
7
|
+
data.tar.gz: d24096d26076067c67594216aa4086cbfb5c2bd650d66f114a45ab855203128e7c440f4571cbbe68ae3f7659adae27ef69c0c190df81f62bd2a3c7f4fc9a5564
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/lib/mongoid-dsl/monkey.rb
CHANGED
@@ -520,8 +520,17 @@ module Mongoid
|
|
520
520
|
return return_array
|
521
521
|
end
|
522
522
|
|
523
|
-
|
524
|
-
|
523
|
+
#> [:none,:self,:one,:many]
|
524
|
+
def relation_to?(klass)
|
525
|
+
raise(ArgumentError,"obj must be class: #{klass}") unless klass <= Class
|
526
|
+
return self.relation_connection_type(klass).to_s.downcase.split('::').last.to_sym
|
527
|
+
end
|
528
|
+
|
529
|
+
#> [:none,:self,:one,:many]
|
530
|
+
def relation_from?(klass)
|
531
|
+
raise(ArgumentError,"obj must be class: #{klass}") unless klass <= Class
|
532
|
+
return self.reverse_relation_conn_type(klass).to_s.downcase.split('::').last.to_sym
|
533
|
+
end
|
525
534
|
|
526
535
|
end
|
527
536
|
|
@@ -537,6 +546,7 @@ module Mongoid
|
|
537
546
|
return nil
|
538
547
|
|
539
548
|
end
|
549
|
+
alias __parent__ _parent
|
540
550
|
|
541
551
|
def _reference
|
542
552
|
|
@@ -548,6 +558,7 @@ module Mongoid
|
|
548
558
|
return nil
|
549
559
|
|
550
560
|
end
|
561
|
+
alias __reference__ _reference
|
551
562
|
|
552
563
|
alias :get_parent_doc :_parent
|
553
564
|
alias :get_reference_doc :_reference
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|