bowtie 0.4 → 0.4.1

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.
data/bowtie.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{bowtie}
3
- s.version = "0.4"
3
+ s.version = "0.4.1"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Tomás Pollak"]
@@ -89,9 +89,14 @@ class Class
89
89
  end
90
90
 
91
91
  def model_associations
92
- h = {}
93
- relationships.map {|r| h[r.name] = r }
94
- h
92
+ return [] if relationships.nil? or relationships.empty?
93
+ if relationships.first.is_a?(Array)
94
+ return relationships
95
+ else
96
+ h = {}
97
+ relationships.map {|r| h[r.name] = r }
98
+ return h
99
+ end
95
100
  end
96
101
 
97
102
  def field_names
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bowtie
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- version: "0.4"
9
+ - 1
10
+ version: 0.4.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - "Tom\xC3\xA1s Pollak"