Sha256: 2dc641782730604970febc5de059b671dde3c6f1ba96892b778417b51a390883

Contents?: true

Size: 727 Bytes

Versions: 4

Compression:

Stored size: 727 Bytes

Contents

module ROM
  module Yesql
    class Relation < ROM::Relation
      module ClassInterface
        # Sets dataset name for the relation class
        #
        # The class will be extended with queries registered under that name.
        # By default dataset name is derived from the class name, which doesn't
        # have to match the key under which its queries were registered
        #
        # @param name [String]
        #
        # @return [Symbol]
        #
        # @api public
        def dataset(name = Undefined)
          return @dataset if name == Undefined
          @dataset = name
          define_query_methods(self, Relation.queries[name] || {})
          @dataset
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rom-yesql-0.5.1 lib/rom/yesql/relation/class_interface.rb
rom-yesql-0.5.0 lib/rom/yesql/relation/class_interface.rb
rom-yesql-0.4.0 lib/rom/yesql/relation/class_interface.rb
rom-yesql-0.3.0 lib/rom/yesql/relation/class_interface.rb