diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-06 22:21:38 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-06 22:21:38 +0900 |
commit | 2ee96632b640da0d09b164ed67b1a9f6b96594b3 (patch) | |
tree | 0d469ebadd2ddf538b0efd2eac8b776675230864 /activerecord/lib | |
parent | e5434b038985906f17b3663766a0588dd8998b17 (diff) | |
download | rails-2ee96632b640da0d09b164ed67b1a9f6b96594b3.tar.gz rails-2ee96632b640da0d09b164ed67b1a9f6b96594b3.tar.bz2 rails-2ee96632b640da0d09b164ed67b1a9f6b96594b3.zip |
Delegate `ast` and `locked` to `arel` explicitly
Currently `ast` and `locked` are used in the internal but delegating to
`arel` is depend on `method_missing`. If a model class is defined these
methods, `select_all` will be broken.
It should be delegated to `arel` explicitly.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 5775eda5a5..b61ac84155 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -18,6 +18,7 @@ module ActiveRecord attr_reader :table, :klass, :loaded, :predicate_builder alias :model :klass alias :loaded? :loaded + alias :locked? :locked def initialize(klass, table, predicate_builder, values = {}) @klass = klass diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index 257ae04ff4..4f739a0415 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -46,6 +46,8 @@ module ActiveRecord delegate :table_name, :quoted_table_name, :primary_key, :quoted_primary_key, :connection, :columns_hash, to: :klass + delegate :ast, :locked, to: :arel + module ClassSpecificRelation # :nodoc: extend ActiveSupport::Concern |