Sha256: cb1954d99e240ea3279bbd19c5ddf2b8492ab0be81690d1d209cc1920747a50d

Contents?: true

Size: 1008 Bytes

Versions: 37

Compression:

Stored size: 1008 Bytes

Contents

module Sequel
  module Plugins
    # The unlimited_update plugin is designed to work around a
    # MySQL warning in replicated environments, which occurs if
    # you issue an UPDATE with a LIMIT clause.  No other
    # database Sequel supports will create an UPDATE clause with
    # a LIMIT, and in non-replicated MySQL environments, MySQL
    # doesn't issue a warning.  Note that even in replicated
    # environments the MySQL warning is harmless, as Sequel
    # restricts an update to rows with a matching primary key,
    # which should be unique.
    #
    # Usage:
    #
    #   # Make all model subclass not use a limit for update
    #   Sequel::Model.plugin :unlimited_update
    #
    #   # Make the Album class not use a limit for update
    #   Album.plugin :unlimited_update
    module UnlimitedUpdate
      module InstanceMethods
        private

        # Use an unlimited dataset for updates.
        def _update_dataset
          super.unlimited
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
sequel-4.30.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.29.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.28.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.27.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.26.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.25.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.24.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.23.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.22.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.21.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.20.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.19.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.18.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.17.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.16.0 lib/sequel/plugins/unlimited_update.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/unlimited_update.rb
sequel-4.15.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.14.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.13.0 lib/sequel/plugins/unlimited_update.rb
sequel-4.12.0 lib/sequel/plugins/unlimited_update.rb