lib/sequel/postgres/schemata.rb in sequel-postgres-schemata-0.0.1 vs lib/sequel/postgres/schemata.rb in sequel-postgres-schemata-0.0.2
- old
+ new
@@ -27,19 +27,21 @@
# to the server verbatim) and lists of symbols or strings.
def search_path= search_path
case search_path
when String
search_path = search_path.split(",").map{|s| s.strip}
+ when Symbol
+ search_path = [search_path]
when Array
# nil
else
raise Error, "unrecognized value for search_path: #{search_path.inspect}"
end
self << "SET search_path = #{search_path.map{|s| "\"#{s.to_s.gsub('"', '""')}\""}.join(',')}"
end
- # Returns the current schemata, as return by current_schemas(false).
+ # Returns the current schemata, as returned by current_schemas(false).
def current_schemata
metadata_dataset.select(Sequel::function(:current_schemas, false).
cast('varchar[]')).single_value.map(&:to_sym)
end
@@ -58,7 +60,9 @@
end
module DatabaseMethods
include ::Sequel::Postgres::Schemata::DatabaseMethods
end
+
+ Database.send :include, ::Sequel::Postgres::Schemata::DatabaseMethods if defined? Database
end
end