towsta 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/towsta/version.rb +1 -1
- data/lib/towsta/vertical.rb +8 -1
- metadata +3 -3
data/lib/towsta/version.rb
CHANGED
data/lib/towsta/vertical.rb
CHANGED
@@ -93,7 +93,14 @@ module Towsta
|
|
93
93
|
|
94
94
|
def attributes
|
95
95
|
horizontal = {:vertical => self.class.to_s}
|
96
|
-
self.class.attributes.each
|
96
|
+
self.class.attributes.each do |attr|
|
97
|
+
foreings = Vertical.all + [User]
|
98
|
+
if foreings.include? eval(attr.to_s).class
|
99
|
+
horizontal[attr] = eval(attr.to_s).id
|
100
|
+
else
|
101
|
+
horizontal[attr] = eval(attr.to_s).to_s
|
102
|
+
end
|
103
|
+
end
|
97
104
|
horizontal
|
98
105
|
end
|
99
106
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 9
|
9
|
+
version: 0.2.9
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mortaro
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-03-
|
17
|
+
date: 2011-03-21 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|