From 0d70ce37e510c83d5fc42f88b04314f40d87fe96 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Mon, 11 Feb 2008 23:09:15 -0800 Subject: rename substitute to bind since it 'binds' an object to a new relation. --- lib/active_relation/primitives/attribute.rb | 2 +- lib/active_relation/primitives/expression.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/active_relation/primitives') diff --git a/lib/active_relation/primitives/attribute.rb b/lib/active_relation/primitives/attribute.rb index 893feefef2..de25a90868 100644 --- a/lib/active_relation/primitives/attribute.rb +++ b/lib/active_relation/primitives/attribute.rb @@ -15,7 +15,7 @@ module ActiveRelation Attribute.new(relation, name, aliaz, self) end - def substitute(new_relation) + def bind(new_relation) relation == new_relation ? self : Attribute.new(new_relation, name, @alias, self) end diff --git a/lib/active_relation/primitives/expression.rb b/lib/active_relation/primitives/expression.rb index ff07c40109..6ff06c7f81 100644 --- a/lib/active_relation/primitives/expression.rb +++ b/lib/active_relation/primitives/expression.rb @@ -10,8 +10,8 @@ module ActiveRelation end module Transformations - def substitute(new_relation) - new_relation == relation ? self : Expression.new(attribute.substitute(new_relation), function_sql, @alias, self) + def bind(new_relation) + new_relation == relation ? self : Expression.new(attribute.bind(new_relation), function_sql, @alias, self) end def as(aliaz) -- cgit v1.2.3