Created
October 16, 2014 13:18
-
-
Save wacaw/d992717701633a30d5d8 to your computer and use it in GitHub Desktop.
Generate factories from existing model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#run in rails console and paste in comand line to generate | |
Rails.application.eager_load! | |
ActiveRecord::Base.descendants.map do |f| | |
columns = f.columns.collect{|c| "#{c.name}:#{c.type}" }.join(' ') | |
puts "rails g factory_girl:model #{f} #{columns}" | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment