Skip to content
Browse files

Merge remote branch 'ryan/master'

Conflicts:
	.gitignore
	Gemfile.lock
	fixture_builder.gemspec
  • Loading branch information...
2 parents a304ca3 + ff7ce5b commit 2b48ec7d952df915857a541ae9a51b494b2dde77 Dennis Collinson & Ryan Dy committed Aug 10, 2011
Showing with 12 additions and 42 deletions.
  1. +1 −0 .gitignore
  2. +0 −39 Gemfile.lock
  3. +8 −0 README.markdown
  4. +2 −2 fixture_builder.gemspec
  5. +1 −1 lib/fixture_builder/version.rb
View
1 .gitignore
@@ -4,3 +4,4 @@ pkg/
*.db
tmp/fixture_builder.yml
test/fixtures/magical_creatures.yml
+Gemfile.lock
View
39 Gemfile.lock
@@ -1,39 +0,0 @@
-PATH
- remote: .
- specs:
- fixture_builder (0.2.2)
- activerecord
-
-GEM
- remote: http://rubygems.org/
- specs:
- active_support (3.0.0)
- activesupport (= 3.0.0)
- activemodel (3.0.0)
- activesupport (= 3.0.0)
- builder (~> 2.1.2)
- i18n (~> 0.4.1)
- activerecord (3.0.0)
- activemodel (= 3.0.0)
- activesupport (= 3.0.0)
- arel (~> 1.0.0)
- tzinfo (~> 0.3.23)
- activesupport (3.0.0)
- arel (1.0.1)
- activesupport (~> 3.0.0)
- builder (2.1.2)
- i18n (0.4.2)
- rake (0.8.7)
- sqlite3 (1.3.3)
- test-unit (2.3.0)
- tzinfo (0.3.29)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- active_support (>= 3.0)
- fixture_builder!
- rake (= 0.8.7)
- sqlite3
- test-unit
View
8 README.markdown
@@ -51,7 +51,15 @@ FixtureBuilder guesses about how to name fixtures based on a prioritized list of
fbuilder.name(:davids_ipod, Factory(:purchase, :user => david, :product => ipod))
@davids_ipod = Factory(:purchase, :user => david, :product => ipod)
+
+Another way to name fixtures is to use the name_model_with. To use it you create a block that returns how you want a certain model name based on the record field.
+ fbuilder.name_model_with(User) do |record|
+ [record['first_name'], record['last_name']].join('_')
+ end
+
+For all User fixture {first_name: 'foo', last_name: 'bar'} it would generate `foo_bar` as the fixture name.
+
There are also additional configuration options that can be changed to override the defaults:
* files_to_check: array of filenames that when changed cause fixtures to be rebuilt
View
4 fixture_builder.gemspec
@@ -23,8 +23,8 @@ Gem::Specification.new do |s|
s.rubyforge_project = %q{fixture_builder}
s.summary = %q{Build YAML fixtures using object factories}
- s.add_dependency(%q{activerecord})
- s.add_development_dependency(%q{active_support}, ">= 3.0")
+ s.add_dependency(%q{activerecord}, '>= 2')
+ s.add_dependency(%q{activesupport}, '>= 2')
s.add_development_dependency(%q{rake}, '0.8.7')
s.add_development_dependency(%q{test-unit})
s.add_development_dependency(%q{sqlite3})
View
2 lib/fixture_builder/version.rb
@@ -1,3 +1,3 @@
module FixtureBuilder
- VERSION = '0.2.2'
+ VERSION = '0.2.3'
end

0 comments on commit 2b48ec7

Please sign in to comment.
Something went wrong with that request. Please try again.