Class: Product::Survey::Story

Inherits:
Story
  • Object
show all
Defined in:
app/models/product/survey/story.rb

Instance Method Summary collapse

Instance Method Details

#submit_page(page_position, user) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/models/product/survey/story.rb', line 4

def submit_page(page_position, user)
  next_page_position = pages.where(:position.gt => page_position).order_by(position: 'asc').first.try(:position)
 
  unless next_page_position
    self.users_without_tasks_ids ||= []
    self.users_without_tasks_ids << user.id
    save
  end
  
  return next_page_position
end