Skip to content

Commit

Permalink
Fix Active Record relations spec expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
paracycle committed Apr 29, 2022
1 parent dfd1f26 commit 5f90df1
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions spec/tapioca/dsl/compilers/active_record_relations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def find_or_create_by!(attributes, &block); end
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Post).void)).returns(::Post) }
def find_or_initialize_by(attributes, &block); end
sig { returns(T.nilable(::Post)) }
def find_sole_by; end
sig { params(limit: T.untyped).returns(T.untyped) }
def first(limit = nil); end
Expand Down Expand Up @@ -180,6 +183,9 @@ def second_to_last; end
sig { returns(::Post) }
def second_to_last!; end
sig { returns(T.nilable(::Post)) }
def sole; end
sig { params(column_name: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped))).returns(T.untyped) }
def sum(column_name = nil, &block); end
Expand Down Expand Up @@ -224,6 +230,9 @@ def eager_load(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def except(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def excluding(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def extending(*args, &blk); end
Expand All @@ -239,6 +248,9 @@ def group(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def having(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def in_order_of(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def includes(*args, &blk); end
Expand All @@ -254,6 +266,9 @@ def insert_all(attributes, returning: nil, unique_by: nil); end
sig { params(attributes: T::Array[Hash], returning: T.nilable(T.any(T::Array[Symbol], FalseClass))).returns(ActiveRecord::Result) }
def insert_all!(attributes, returning: nil); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def invert_where(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def joins(*args, &blk); end
Expand Down Expand Up @@ -317,6 +332,9 @@ def select(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def strict_loading(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def structurally_compatible?(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def uniq!(*args, &blk); end
Expand All @@ -331,6 +349,9 @@ def upsert_all(attributes, returning: nil, unique_by: nil); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationWhereChain) }
def where(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def without(*args, &blk); end
end
module GeneratedRelationMethods
Expand All @@ -355,6 +376,9 @@ def eager_load(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def except(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def excluding(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def extending(*args, &blk); end
Expand All @@ -370,9 +394,15 @@ def group(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def having(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def in_order_of(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def includes(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def invert_where(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def joins(*args, &blk); end
Expand Down Expand Up @@ -436,6 +466,9 @@ def select(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def strict_loading(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def structurally_compatible?(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def uniq!(*args, &blk); end
Expand All @@ -444,6 +477,9 @@ def unscope(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationWhereChain) }
def where(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def without(*args, &blk); end
end
class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation
Expand All @@ -459,6 +495,9 @@ def to_ary; end
class PrivateAssociationRelationWhereChain < PrivateAssociationRelation
Elem = type_member { { fixed: ::Post } }
sig { params(args: T.untyped).returns(PrivateAssociationRelation) }
def associated(*args); end
sig { params(args: T.untyped).returns(PrivateAssociationRelation) }
def missing(*args); end
Expand Down Expand Up @@ -525,6 +564,9 @@ def to_ary; end
class PrivateRelationWhereChain < PrivateRelation
Elem = type_member { { fixed: ::Post } }
sig { params(args: T.untyped).returns(PrivateRelation) }
def associated(*args); end
sig { params(args: T.untyped).returns(PrivateRelation) }
def missing(*args); end
Expand Down

0 comments on commit 5f90df1

Please sign in to comment.