lib/hypershield.rb in hypershield-0.3.1 vs lib/hypershield.rb in hypershield-0.4.0
- old
+ new
@@ -1,14 +1,14 @@
# dependencies
require "active_support"
# modules
-require "hypershield/migration"
-require "hypershield/version"
+require_relative "hypershield/migration"
+require_relative "hypershield/version"
# integrations
-require "hypershield/engine" if defined?(Rails)
+require_relative "hypershield/engine" if defined?(Rails)
module Hypershield
class << self
attr_accessor :enabled, :log_sql, :schemas
end
@@ -27,11 +27,11 @@
execute("DROP VIEW IF EXISTS #{quote_ident(schema)}.#{quote_ident(view)}")
end
end
def refresh(dry_run: false)
- if adapter_name =~ /sqlite/i
+ if adapter_name.match?(/sqlite/i)
raise "Adapter not supported: #{adapter_name}"
end
quiet_logging do
statements = []
@@ -102,10 +102,10 @@
def adapter_name
connection.adapter_name
end
def mysql?
- adapter_name =~ /mysql/i
+ adapter_name.match?(/mysql/i)
end
def tables(schema = nil)
if schema
schema = quote(schema)