Skip to content

Commit aee3ec3

Browse files
committed
Define name delegator on Relation
If name is called on Relation it should be delegated to the model and doesn't require scoping.
1 parent 90946da commit aee3ec3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/relation/delegation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def #{method}(...)
103103
:to_sentence, :to_fs, :to_formatted_s, :as_json,
104104
:shuffle, :split, :slice, :index, :rindex, to: :records
105105

106-
delegate :primary_key, :with_connection, :connection, :table_name, :transaction, :sanitize_sql_like, :unscoped, to: :model
106+
delegate :primary_key, :with_connection, :connection, :table_name, :transaction, :sanitize_sql_like, :unscoped, :name, to: :model
107107

108108
module ClassSpecificRelation # :nodoc:
109109
extend ActiveSupport::Concern

0 commit comments

Comments
 (0)