lib/sequel/extensions/columns_introspection.rb in sequel-3.48.0 vs lib/sequel/extensions/columns_introspection.rb in sequel-4.0.0
- old
+ new
@@ -25,11 +25,11 @@
def columns
return @columns if @columns
if (pcs = probable_columns) && pcs.all?
@columns = pcs
else
- columns_without_introspection
+ super
end
end
protected
@@ -72,20 +72,9 @@
col.is_a?(SQL::Identifier) ? col.value.to_sym : col.to_sym
when SQL::AliasedExpression
a = c.aliaz
a.is_a?(SQL::Identifier) ? a.value.to_sym : a.to_sym
end
- end
- end
-
- class Dataset
- alias columns_without_introspection columns
-
- # Enable column introspection for every dataset.
- def self.introspect_all_columns
- Sequel::Deprecation.deprecate('Sequel::Dataset.introspect_all_columns', "Please use Database.extension :columns_introspection to load the extension into all databases")
- include ColumnsIntrospection
- remove_method(:columns) if instance_methods(false).map{|x| x.to_s}.include?('columns')
end
end
Dataset.register_extension(:columns_introspection, Sequel::ColumnsIntrospection)
end