Skip to content
Browse files

Add support for Fabrication fabricators

  • Loading branch information...
1 parent 672a22a commit 2957837b7592eb6deedf13c5847cc0bc57cb07e0 @ijcd committed Dec 20, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/annotate/annotate_models.rb
View
7 lib/annotate/annotate_models.rb
@@ -17,6 +17,9 @@ class << self
# FactoryGirl http://github.com/thoughtbot/factory_girl
FACTORIES_TEST_DIR = File.join("test", "factories")
FACTORIES_SPEC_DIR = File.join("spec", "factories")
+ # Fabrication https://github.com/paulelliott/fabrication.git
+ FABRICATORS_TEST_DIR = File.join("test", "fabricators")
+ FABRICATORS_SPEC_DIR = File.join("spec", "fabricators")
def model_dir
@@ -169,7 +172,7 @@ def remove_annotation_of_file(file_name)
# of the model and fixture source files.
# Returns true or false depending on whether the source
# files were modified.
- def annotate(klass, file, header,options={})
+ def annotate(klass, file, header, options={})
info = get_schema_info(klass, header, options)
annotated = false
model_name = klass.name.underscore
@@ -198,6 +201,8 @@ def annotate(klass, file, header,options={})
File.join(BLUEPRINTS_DIR, "#{model_name}_blueprint.rb"), # Machinist Blueprints
File.join(FACTORIES_TEST_DIR, "#{model_name.pluralize}.rb"), # FactoryGirl Factories
File.join(FACTORIES_SPEC_DIR, "#{model_name.pluralize}.rb"), # FactoryGirl Factories
+ File.join(FABRICATORS_TEST_DIR, "#{model_name}_fabricator.rb"), # Fabrication Fabricators
+ File.join(FABRICATORS_SPEC_DIR, "#{model_name}_fabricator.rb"), # Fabrication Fabricators
].each do |file|
if annotate_one_file(file, info, options_with_position(options, :position_in_fixture))
annotated = true

0 comments on commit 2957837

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