Class: Action::User::Welcome

Inherits:
Object
  • Object
show all
Includes:
InchCI::Action
Defined in:
app/services/action/user/welcome.rb

Constant Summary collapse

LIMIT =
9

Instance Method Summary collapse

Methods included from InchCI::Action

#exposures, included

Constructor Details

#initialize(user) ⇒ Welcome


12
13
14
15
16
17
18
19
20
21
# File 'app/services/action/user/welcome.rb', line 12

def initialize(user)
  @user = user
  @followed_projects = find_projects(user).select(&:badge?)
  count = @followed_projects.size
  if count < LIMIT
    @followed_projects.concat featured_projects(LIMIT-count)
  else
    @followed_projects = @followed_projects[0...LIMIT]
  end
end