fixture_builder 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +8 -4
- data/fixture_builder.gemspec +1 -0
- data/lib/fixture_builder/builder.rb +2 -2
- data/lib/fixture_builder/version.rb +1 -1
- metadata +4 -3
data/README.markdown
CHANGED
@@ -90,10 +90,14 @@ One problem with generating your fixtures is that sequences can collide. When t
|
|
90
90
|
end
|
91
91
|
|
92
92
|
# Have factory girl generate non-colliding sequences starting at 1000 for data created after the fixtures
|
93
|
-
|
94
|
-
|
93
|
+
|
94
|
+
# Factory Girl <2 yields name & seq
|
95
|
+
# Factory Girl >2 yeilds only seq
|
96
|
+
FactoryGirl.sequences.each do |seq|
|
97
|
+
|
98
|
+
# Factory Girl 4 uses an Enumerator Adapter, otherwise simply set a Fixnum
|
99
|
+
seq.instance_variable_set(:@value, FactoryGirl::Sequence::EnumeratorAdapter.new(2000))
|
100
|
+
|
95
101
|
end
|
96
102
|
|
97
|
-
|
98
|
-
|
99
103
|
Copyright (c) 2009 Ryan Dy & David Stevenson, released under the MIT license
|
data/fixture_builder.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.authors = ['Ryan Dy', 'David Stevenson']
|
11
11
|
s.description = %q{FixtureBuilder allows testers to use their existing factories, like FactoryGirl, to generate high performance fixtures that can be shared across all your tests}
|
12
12
|
s.email = %q{mail@ryandy.com}
|
13
|
+
s.licenses = ['MIT']
|
13
14
|
s.extra_rdoc_files = [
|
14
15
|
'README.markdown'
|
15
16
|
]
|
@@ -88,7 +88,7 @@ module FixtureBuilder
|
|
88
88
|
begin
|
89
89
|
fixtures = tables.inject([]) do |files, table_name|
|
90
90
|
table_klass = table_name.classify.constantize rescue nil
|
91
|
-
if table_klass
|
91
|
+
if table_klass && table_klass < ActiveRecord::Base
|
92
92
|
rows = table_klass.unscoped { table_klass.all.collect(&:attributes) }
|
93
93
|
else
|
94
94
|
rows = ActiveRecord::Base.connection.select_all(select_sql % ActiveRecord::Base.connection.quote_table_name(table_name))
|
@@ -120,4 +120,4 @@ module FixtureBuilder
|
|
120
120
|
fixtures_dir("#{table_name}.yml")
|
121
121
|
end
|
122
122
|
end
|
123
|
-
end
|
123
|
+
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.
|
4
|
+
version: 0.3.5
|
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-
|
13
|
+
date: 2012-12-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -141,7 +141,8 @@ files:
|
|
141
141
|
- test/test_helper.rb
|
142
142
|
- tmp/.gitkeep
|
143
143
|
homepage: http://github.com/rdy/fixture_builder
|
144
|
-
licenses:
|
144
|
+
licenses:
|
145
|
+
- MIT
|
145
146
|
post_install_message:
|
146
147
|
rdoc_options: []
|
147
148
|
require_paths:
|