Skip to content

Commit

Permalink
Fix migration load order
Browse files Browse the repository at this point in the history
  • Loading branch information
aviflombaum committed Feb 9, 2016
1 parent 94b0540 commit fb1ef32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def migrate_db
DB.execute("DROP TABLE #{table}")
end

Dir[File.join(File.dirname(__FILE__), "../db/migrate", "*.rb")].each do |f|
Dir[File.join(File.dirname(__FILE__), "../db/migrate", "*.rb")].sort.each do |f|
require f
migration = Kernel.const_get(f.split("/").last.split(".rb").first.gsub(/\d+/, "").split("_").collect{|w| w.strip.capitalize}.join())
migration.migrate(:up)
Expand Down

0 comments on commit fb1ef32

Please sign in to comment.