diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-10-10 21:32:01 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-10-11 11:54:46 -0200 |
commit | e0b76d6151821527f16b3f163abde3ebea1b2a50 (patch) | |
tree | c303ea44988442d7dfbe021586978bba2d2de22a /activerecord/lib | |
parent | 21a92b8d01eed34a6b26adb51139f1c40467409e (diff) | |
download | rails-e0b76d6151821527f16b3f163abde3ebea1b2a50.tar.gz rails-e0b76d6151821527f16b3f163abde3ebea1b2a50.tar.bz2 rails-e0b76d6151821527f16b3f163abde3ebea1b2a50.zip |
reorder removed in favor of except(:order).order
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 11 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/spawn_methods.rb | 11 |
3 files changed, 3 insertions, 21 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ff6be4ff19..78b3507dd9 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -423,7 +423,7 @@ module ActiveRecord #:nodoc: class << self # Class methods delegate :find, :first, :last, :all, :destroy, :destroy_all, :exists?, :delete, :delete_all, :update, :update_all, :to => :scoped delegate :find_each, :find_in_batches, :to => :scoped - delegate :select, :group, :order, :reorder, :limit, :offset, :joins, :where, :preload, :eager_load, :includes, :from, :lock, :readonly, :having, :create_with, :to => :scoped + delegate :select, :group, :order, :except, :limit, :offset, :joins, :where, :preload, :eager_load, :includes, :from, :lock, :readonly, :having, :create_with, :to => :scoped delegate :count, :average, :minimum, :maximum, :sum, :calculate, :to => :scoped # Executes a custom SQL query against your database and returns all the results. The results will diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 001207514d..a5dc051c6e 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -6,7 +6,7 @@ module ActiveRecord extend ActiveSupport::Concern attr_accessor :includes_values, :eager_load_values, :preload_values, - :select_values, :group_values, :order_values, :reorder_flag, :joins_values, :where_values, :having_values, + :select_values, :group_values, :order_values, :joins_values, :where_values, :having_values, :limit_value, :offset_value, :lock_value, :readonly_value, :create_with_value, :from_value def includes(*args) @@ -53,15 +53,6 @@ module ActiveRecord relation end - def reorder(*args) - relation = clone - unless args.blank? - relation.order_values = args - relation.reorder_flag = true - end - relation - end - def joins(*args) relation = clone diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index 9ecdb99bee..dcddc3dac4 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -19,20 +19,11 @@ module ActiveRecord end end - (Relation::MULTI_VALUE_METHODS - [:joins, :where, :order]).each do |method| + (Relation::MULTI_VALUE_METHODS - [:joins, :where]).each do |method| value = r.send(:"#{method}_values") merged_relation.send(:"#{method}_values=", merged_relation.send(:"#{method}_values") + value) if value.present? end - order_value = r.order_values - if order_value.present? - if r.reorder_flag - merged_relation.order_values = order_value - else - merged_relation.order_values = merged_relation.order_values + order_value - end - end - merged_relation = merged_relation.joins(r.joins_values) merged_wheres = @where_values |