Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (15 sloc) 465 Bytes
class FactoryGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
m.directory File.join('test/factories', class_path)
m.template 'factory.rb', File.join('test/factories', class_path, "#{file_name}_factory.rb")
end
end
def factory_line(attribute)
"#{file_name}.#{attribute.name} '#{attribute.default}'"
end
protected
def banner
"Usage: #{$0} #{spec.name} FactoryName [field:type, field:type]"
end
end
Something went wrong with that request. Please try again.