somehow_has_relation 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module SomehowHasRelation
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -27,7 +27,7 @@ module SomehowHasRelation
27
27
  define_method(related) do
28
28
  found = somehow_found_or_recur relation, current_options[:if], current_options
29
29
  if current_options.has_key?(:one)
30
- found.flatten.compact.first rescue found
30
+ found.flatten.compact.first rescue nil
31
31
  elsif current_options.has_key?(:many)
32
32
  found.flatten.compact rescue []
33
33
  end
@@ -58,7 +58,7 @@ module SomehowHasRelation
58
58
  if opt.has_key?(:through)
59
59
  found << somehow_recur(relation, opt[:through], opt[:if])
60
60
  else
61
- return send_and_filter(relation, condition)
61
+ return [send_and_filter(relation, condition)]
62
62
  end
63
63
  rescue
64
64
  found << []
@@ -67,7 +67,7 @@ module SomehowHasRelation
67
67
 
68
68
  found
69
69
  else
70
- send_and_filter(relation, condition)
70
+ [send_and_filter(relation, condition)]
71
71
  end
72
72
  end
73
73
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: somehow_has_relation
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matteo Latini
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-22 00:00:00 +01:00
18
+ date: 2011-03-23 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21