lib/edge_rider/development.rb in edge_rider-0.3.1 vs lib/edge_rider/development.rb in edge_rider-0.3.2
- old
+ new
@@ -1,26 +1,13 @@
module EdgeRider
module Development
extend self
- def drop_all_tables
- connection = ::ActiveRecord::Base.connection
- connection.tables.each do |table|
- connection.drop_table table
- end
- end
-
- def migrate_test_database
- print "\033[30m" # dark gray text
- drop_all_tables
- ::ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
- print "\033[0m"
- end
-
def selects_star_with_conditions_pattern(table, conditions)
table = Regexp.quote(table)
conditions = Regexp.quote(conditions) unless conditions.is_a?(Regexp)
- /\ASELECT (`#{table}`\.)?\* FROM `#{table}`\s+WHERE \(?#{conditions}\)?\s*\z/
+ quote = '[`"]?'
+ /\ASELECT (#{quote}#{table}#{quote}\.)?\* FROM #{quote}#{table}#{quote}\s+WHERE \(?#{conditions}\)?\s*\z/
end
end
end