Module: ROM::Yesql::Relation::ClassInterface

Defined in:
lib/rom/yesql/relation/class_interface.rb

Instance Method Summary collapse

Instance Method Details

#dataset(name = Undefined) ⇒ Symbol

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

Parameters:

  • name (String) (defaults to: Undefined)

Returns:

  • (Symbol)


16
17
18
19
20
21
# File 'lib/rom/yesql/relation/class_interface.rb', line 16

def dataset(name = Undefined)
  return @dataset if name == Undefined
  @dataset = name
  define_query_methods(self, Relation.queries[name] || {})
  @dataset
end