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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 372d53d1aed4d20d50950a902a1afc589e63ad38
4
- data.tar.gz: 3ff39915be54309d206c31f0f32ab706b4de2e22
3
+ metadata.gz: d37b0c5bd20a3683ae4c76517067425243b05167
4
+ data.tar.gz: a4daa266cce7305dc49cbe06d8e2b58ae18955b0
5
5
  SHA512:
6
- metadata.gz: a86d8aab7e0013a166222f6d2b9fdb77757d4205eefefee51864a93063bec01758f1b7cec61cf6affec5703c098b1954f41a52d22dfc69bf33a3e76550d82f06
7
- data.tar.gz: 445636d49a606e87561b1cd168b23fb23846e625027ea99aacbca08ca746e079f14f78bc0599d171df52643065fa5e07249c52c84262e1a92cf2b679df36a5d0
6
+ metadata.gz: 5f40b0a3a3e312ea6826548c6aa0f60f5b91075101672c199014122efcadca90c8b3c4f3b91625781a85003a7fad724bf89097dd75db0665e10b8a7548554f54
7
+ data.tar.gz: d24096d26076067c67594216aa4086cbfb5c2bd650d66f114a45ab855203128e7c440f4571cbbe68ae3f7659adae27ef69c0c190df81f62bd2a3c7f4fc9a5564
data/README.md CHANGED
@@ -113,3 +113,5 @@ The return object will be array if the target model is not a main one but an emb
113
113
 
114
114
  ```
115
115
 
116
+
117
+ you can find working examples in the example folder
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -520,8 +520,17 @@ module Mongoid
520
520
  return return_array
521
521
  end
522
522
 
523
- alias :this_to_me :relation_connection_type
524
- alias :me_to_this :reverse_relation_conn_type
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.2
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-07 00:00:00.000000000 Z
11
+ date: 2014-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler