Skip to content

Instantly share code, notes, and snippets.

@jonpaul
Created July 6, 2012 18:55
Show Gist options
  • Save jonpaul/3062045 to your computer and use it in GitHub Desktop.
Save jonpaul/3062045 to your computer and use it in GitHub Desktop.
import method
class Transition
def self.sql_dump_import(dump_file)
sql = File.open(dump_file).read
sql.split(';').each do |sql_statement|
ActiveRecord::Base.connection.execute(sql_statement) unless sql_statement.blank?
end
return true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment