Module: SorbetRails::CustomFinderMethods

Defined in:
lib/sorbet-rails/rails_mixins/custom_finder_methods.rb

Instance Method Summary collapse

Instance Method Details

#find_by_id(id) ⇒ Object

Redeclare these dynamic methods here otherwise they will be generated by ‘srb rbi hidden-definitions`



18
19
20
# File 'lib/sorbet-rails/rails_mixins/custom_finder_methods.rb', line 18

def find_by_id(id)
  find_by(id: id)
end

#find_by_id!(id) ⇒ Object



22
23
24
# File 'lib/sorbet-rails/rails_mixins/custom_finder_methods.rb', line 22

def find_by_id!(id)
  find_by!(id: id)
end

#find_n(*ids) ⇒ Object



4
5
6
# File 'lib/sorbet-rails/rails_mixins/custom_finder_methods.rb', line 4

def find_n(*ids)
  find(*ids)
end

#first_n(n) ⇒ Object



8
9
10
# File 'lib/sorbet-rails/rails_mixins/custom_finder_methods.rb', line 8

def first_n(n)
  first(n)
end

#last_n(n) ⇒ Object



12
13
14
# File 'lib/sorbet-rails/rails_mixins/custom_finder_methods.rb', line 12

def last_n(n)
  last(n)
end