Module: FinderMethods

Instance Method Summary collapse

Instance Method Details

#find(*args) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


17
18
19
# File 'app/finders/concerns/finder_methods.rb', line 17

def find(*args)
  raise_not_found_unless_authorized execute.reorder(nil).find(*args)
end

#find_by(*args) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


11
12
13
# File 'app/finders/concerns/finder_methods.rb', line 11

def find_by(*args)
  if_authorized execute.reorder(nil).find_by(*args)
end

#find_by!(*args) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


5
6
7
# File 'app/finders/concerns/finder_methods.rb', line 5

def find_by!(*args)
  raise_not_found_unless_authorized execute.reorder(nil).find_by!(*args)
end