module ROM::Yesql::Relation::ClassInterface

Public Instance Methods

dataset(name = Undefined) click to toggle source

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

# File lib/rom/yesql/relation/class_interface.rb, line 18
def dataset(name = Undefined)
  name = relation_name.to_sym if name == Undefined
  define_query_methods(self, Relation.queries[name] || {})
  ->(*) { self }
end