Created
July 1, 2014 00:34
-
-
Save domgetter/0d1f4c4e0043467a1e83 to your computer and use it in GitHub Desktop.
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
# From activerecord/lib/active_record/tasks/database_tasks.rb ~line 199 | |
# ... | |
def load_seed | |
if seed_loader | |
ActiveRecord::Base.transaction do # <- Wrapped seeder in a transaction block | |
seed_loader.load_seed # | |
end # | |
else | |
raise "You tried to load seed data, but no seed loader is specified. Please specify seed " + | |
"loader with ActiveRecord::Tasks::DatabaseTasks.seed_loader = your_seed_loader\n" + | |
"Seed loader should respond to load_seed method" | |
end | |
end | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment