Changeset 4129
- Timestamp:
- 04/01/06 23:15:35 (2 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/base.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r4124 r4129 1 1 *SVN* 2 3 * Private ActiveRecord methods add_limit!, add_joins!, and add_conditions! take an OPTIONAL third argument 'scope' (closes #4456) [Rick] 2 4 3 5 * DEPRECATED: Using additional attributes on has_and_belongs_to_many associations. Instead upgrade your association to be a real join model [DHH] trunk/activerecord/lib/active_record/base.rb
r4124 r4129 1037 1037 end 1038 1038 1039 def add_limit!(sql, options, scope) 1040 if scope 1039 # The optional scope argument is for the current :find scope. 1040 def add_limit!(sql, options, scope = nil) 1041 if scope ||= scope(:find) 1041 1042 options[:limit] ||= scope[:limit] 1042 1043 options[:offset] ||= scope[:offset] … … 1045 1046 end 1046 1047 1047 def add_joins!(sql, options, scope) 1048 # The optional scope argument is for the current :find scope. 1049 def add_joins!(sql, options, scope = nil) 1050 scope ||= scope(:find) 1048 1051 join = (scope && scope[:joins]) || options[:joins] 1049 1052 sql << " #{join} " if join … … 1051 1054 1052 1055 # Adds a sanitized version of +conditions+ to the +sql+ string. Note that the passed-in +sql+ string is changed. 1053 def add_conditions!(sql, conditions, scope) 1056 # The optional scope argument is for the current :find scope. 1057 def add_conditions!(sql, conditions, scope = nil) 1058 scope ||= scope(:find) 1054 1059 segments = [] 1055 1060 segments << sanitize_sql(scope[:conditions]) if scope && scope[:conditions]