Skip to content

Commit

Permalink
test: code to the minimum necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiroe committed Jun 14, 2024
1 parent f9442c1 commit c429445
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 52 deletions.
1 change: 1 addition & 0 deletions gems/activerecord/6.0/_test/activerecord-generated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ def something
User.includes(:address, :friends).to_a
User.preload(:address, friends: [:address, :followers])
User.in_order_of(:id, [1, 5, 3])
User.where.missing.to_sql
8 changes: 1 addition & 7 deletions gems/activerecord/7.0/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ class User < ApplicationRecord
encrypts :secret, :key
encrypts :token, deterministic: true
encrypts :phrase, ignore_case: true

has_many :posts
end

class Post < ApplicationRecord
belongs_to :user
end

User.where.missing(:posts)
User.where.missing.to_sql
User.deterministic_encrypted_attributes
User.source_attribute_from_preserved_attribute(:phrase)
user = User.new(secret: 'dummy', key: 'dummy', token: 'dummy', phrase: 'dummy')
Expand Down
19 changes: 0 additions & 19 deletions gems/activerecord/7.0/_test/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@ module Test
extend ::ActiveRecord::Base::ClassMethods[User, ActiveRecord_Relation, Integer]

class ActiveRecord_Relation < ::ActiveRecord::Relation
include ::ActiveRecord::Relation::Methods[User, Integer]
include Enumerable[User]
end

class ActiveRecord_Associations_CollectionProxy < ::ActiveRecord::Associations::CollectionProxy
include ::ActiveRecord::Relation::Methods[User, Integer]
end
end

class Post < ApplicationRecord
extend ::ActiveRecord::Base::ClassMethods[Post, ActiveRecord_Relation, Integer]

class ActiveRecord_Relation < ::ActiveRecord::Relation
include ::ActiveRecord::Relation::Methods[Post, Integer]
include Enumerable[Post]
end

class ActiveRecord_Associations_CollectionProxy < ::ActiveRecord::Associations::CollectionProxy
include ::ActiveRecord::Relation::Methods[Post, Integer]
end
end
end
8 changes: 1 addition & 7 deletions gems/activerecord/7.1/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@ class User < ApplicationRecord
# @type var email: String
email.strip.downcase
}

has_many :posts
end

class Post < ApplicationRecord
belongs_to :user
end

User.where.missing(:posts)
User.where.missing.to_sql
User.deterministic_encrypted_attributes
User.source_attribute_from_preserved_attribute(:phrase)
user = User.new(secret: 'dummy', key: 'dummy', token: 'dummy', phrase: 'dummy')
Expand Down
19 changes: 0 additions & 19 deletions gems/activerecord/7.1/_test/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@ module Test
extend ::ActiveRecord::Base::ClassMethods[User, ActiveRecord_Relation, Integer]

class ActiveRecord_Relation < ::ActiveRecord::Relation
include ::ActiveRecord::Relation::Methods[User, Integer]
include Enumerable[User]
end

class ActiveRecord_Associations_CollectionProxy < ::ActiveRecord::Associations::CollectionProxy
include ::ActiveRecord::Relation::Methods[User, Integer]
end
end

class Post < ApplicationRecord
extend ::ActiveRecord::Base::ClassMethods[Post, ActiveRecord_Relation, Integer]

class ActiveRecord_Relation < ::ActiveRecord::Relation
include ::ActiveRecord::Relation::Methods[Post, Integer]
include Enumerable[Post]
end

class ActiveRecord_Associations_CollectionProxy < ::ActiveRecord::Associations::CollectionProxy
include ::ActiveRecord::Relation::Methods[Post, Integer]
end
end
end

0 comments on commit c429445

Please sign in to comment.