Method: Query::Composer#alias

Defined in:
lib/query/composer.rb

#alias(new_name, name) ⇒ Object

Aliases the given query component with the new name. This can be useful for redefining an existing component, where you still want to retain the old definition.

composer.use(:source) { Something.all }
composer.alias(:old_source, :source)
composer.use(:source) { |old_source| ... }


158
159
160
161
# File 'lib/query/composer.rb', line 158

def alias(new_name, name)
  @parts[new_name] = @parts[name]
  self
end