Class: Boards::VisitsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/boards/visits_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, current_user) ⇒ VisitsFinder

Returns a new instance of VisitsFinder.



7
8
9
10
# File 'app/finders/boards/visits_finder.rb', line 7

def initialize(parent, current_user)
  @current_user = current_user
  @parent = parent
end

Instance Attribute Details

#current_userObject

Returns the value of attribute current_user.



5
6
7
# File 'app/finders/boards/visits_finder.rb', line 5

def current_user
  @current_user
end

#paramsObject

Returns the value of attribute params.



5
6
7
# File 'app/finders/boards/visits_finder.rb', line 5

def params
  @params
end

#parentObject

Returns the value of attribute parent.



5
6
7
# File 'app/finders/boards/visits_finder.rb', line 5

def parent
  @parent
end

Instance Method Details

#execute(count = nil) ⇒ Object Also known as: latest



12
13
14
15
16
# File 'app/finders/boards/visits_finder.rb', line 12

def execute(count = nil)
  return unless current_user

  recent_visit_model.latest(current_user, parent, count: count)
end