Skip to content

Commit

Permalink
activerecord: Rename AR::Relation::ClassMethods to AR::Base::ClassMet…
Browse files Browse the repository at this point in the history
…hods

In #413, we added `ActiveRecord::Relation::ClassMethods` as a new styled
component of `_ActiveRecord_Relation_ClassMethods`.  But this name is
not good because it is used to enhance the subclasses of `ActiveRecord::Base`,
not the subclasses of `ActiveRecord::Relation`.

It should be renamed to `ActiveRecord::Base::ClassMethods`.

refs:

* https://github.com/pocke/rbs_rails/blob/v0.12.0/lib/rbs_rails/active_record.rb#L33
* #413
  • Loading branch information
tk0miya committed Feb 12, 2024
1 parent adf714d commit 698dd38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gems/activerecord/6.0/activerecord.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ module ActiveRecord
| () { (Model) -> boolish } -> Array[Model]
def reselect: (*Symbol | String) -> self
end
end

class Base
module ClassMethods[Model, Relation, PrimaryKey]
def all: () -> Relation
def ids: () -> Array[PrimaryKey]
Expand Down

0 comments on commit 698dd38

Please sign in to comment.