Sha256: fbe7b86e874bc7bfdebf70acd706e84fd7f871478bb65bb3c3b9c2716e307309

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

module ROM
  module Plugins
    module Command
      # @api private
      module Schema
        def self.included(klass)
          super
          klass.extend(ClassInterface)
        end

        # @api private
        module ClassInterface
          # @see Command.build
          # @api public
          def build(relation, options = {})
            if options.key?(:input) || !relation.schema?
              super
            else
              super(relation, options.merge(input: relation.schema_hash))
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-2.0.1 lib/rom/plugins/command/schema.rb
rom-2.0.0 lib/rom/plugins/command/schema.rb