doc/extensions.rdoc in sequel-4.49.0 vs doc/extensions.rdoc in sequel-5.0.0

- old
+ new

@@ -8,11 +8,11 @@ Global extensions are loaded via <tt>Sequel.extension</tt>: Sequel.extension :named_timezones -What this does is require the relevent extension from <tt>sequel/extensions/named_timezones</tt> somewhere in the ruby path. Actually, that is all that does. Global extensions are just a simpler, consistent way to require code that modifies Sequel. +All this does is require the relevent extension from <tt>sequel/extensions/named_timezones</tt> somewhere in the ruby path. Global extensions are just a simpler, consistent way to require code that modifies Sequel. == Database Extensions Database extensions should add or modify the behavior of a single <tt>Sequel::Database</tt> instance. They are loaded via <tt>Sequel::Database#extension</tt>: @@ -26,21 +26,14 @@ All future <tt>Sequel::Database</tt> instances created afterward will then automatically have the server_block extension loaded. == Dataset Extensions -Dataset extensions should add or modify the behavior of a single <tt>Sequel::Dataset</tt> instance. They are loaded via <tt>Sequel::Dataset#extension</tt> or <tt>Sequel::Dataset#extension!</tt>. <tt>Sequel::Dataset#extension</tt> returns a modifies copy of the dataset that includes the extension (similar to how most dataset query methods work): +Dataset extensions should add or modify the behavior of a single <tt>Sequel::Dataset</tt> instance. They are loaded via <tt>Sequel::Dataset#extension</tt>. <tt>Sequel::Dataset#extension</tt> returns a modifies copy of the dataset that includes the extension (similar to how most dataset query methods work): ds = DB[:a].extension(:columns_introspection) -<tt>Sequel::Dataset#extension!</tt> modifies a dataset to include the extension (similar to how dataset mutation methods work): - - ds = DB[:a] - ds.extension!(:columns_introspection) - -It is recommended you only use <tt>Sequel::Dataset#extension!</tt> if you have good reasons to. - -The first thing loading a Dataset extension does is load the relevent extension globally. Similar to Database extensions, loading a Dataset extension globally should not affect state other than maybe adding a module. After loading the extension globally, it modifies the related <tt>Sequel::Dataset</tt> instance to modify its behavior. +The first thing loading a Dataset extension does is load the relevent extension globally. Similar to Database extensions, loading a Dataset extension globally should not affect state other than maybe adding a module. After loading the extension globally, it returned a modified copy of the <tt>Sequel::Dataset</tt> with the extension loaded into it. If you want to load an extension into all future datasets for a given <tt>Sequel::Database</tt> instance, you can also load it as a Database extension: DB.extension :columns_introspection