towsta 0.2.8 → 0.2.9

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 Towsta
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
@@ -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 {|attr| horizontal[attr] = eval(attr.to_s).to_s}
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
- - 8
9
- version: 0.2.8
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-18 00:00:00 -03:00
17
+ date: 2011-03-21 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency