fixture_builder 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.8.7@fixture_builder --create
1
+ rvm 1.9.3@fixture_builder --create
@@ -89,7 +89,19 @@ module FixtureBuilder
89
89
  fixtures = tables.inject([]) do |files, table_name|
90
90
  table_klass = table_name.classify.constantize rescue nil
91
91
  if table_klass && table_klass < ActiveRecord::Base
92
- rows = table_klass.unscoped { table_klass.all.collect(&:attributes) }
92
+ rows = table_klass.unscoped do
93
+ table_klass.all.collect do |obj|
94
+ attrs = obj.attributes
95
+ attrs.inject({}) do |hash, (attr_name, value)|
96
+ if table_klass.serialized_attributes.has_key? attr_name
97
+ hash[attr_name] = table_klass.serialized_attributes[attr_name].dump(value)
98
+ else
99
+ hash[attr_name] = value
100
+ end
101
+ hash
102
+ end
103
+ end
104
+ end
93
105
  else
94
106
  rows = ActiveRecord::Base.connection.select_all(select_sql % ActiveRecord::Base.connection.quote_table_name(table_name))
95
107
  end
@@ -1,3 +1,3 @@
1
1
  module FixtureBuilder
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixture_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-01 00:00:00.000000000 Z
13
+ date: 2013-06-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -153,6 +153,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
153
  - - ! '>='
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
+ segments:
157
+ - 0
158
+ hash: -260464205711861876
156
159
  required_rubygems_version: !ruby/object:Gem::Requirement
157
160
  none: false
158
161
  requirements:
@@ -161,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
164
  version: '0'
162
165
  requirements: []
163
166
  rubyforge_project: fixture_builder
164
- rubygems_version: 1.8.19
167
+ rubygems_version: 1.8.24
165
168
  signing_key:
166
169
  specification_version: 3
167
170
  summary: Build YAML fixtures using object factories