Class: PickList::Pick

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/pick_list/pick.rb

Overview

A pick represents an intended cherrypick. It pretty much maps exactly to a CherrypickRequest. Currently these are just plain old Ruby objects, but may end up being database backed in future if we update Cherrypicking to avoid the need for submissions. (Although now cherrypicking is billed this may be less useful)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#projectObject



23
24
25
# File 'app/models/pick_list/pick.rb', line 23

def project
  @project || extract_project_from_source_receptacle
end

#source_receptacleObject

Returns the value of attribute source_receptacle.



11
12
13
# File 'app/models/pick_list/pick.rb', line 11

def source_receptacle
  @source_receptacle
end

#studyObject



19
20
21
# File 'app/models/pick_list/pick.rb', line 19

def study
  @study || extract_study_from_source_receptacle
end

#user=(value) ⇒ Object (writeonly)

Sets the attribute user

Parameters:

  • value

    the value to set the attribute user to.



12
13
14
# File 'app/models/pick_list/pick.rb', line 12

def user=(value)
  @user = value
end

Instance Method Details

#order_optionsObject

Used to help group compatible picks together into orders



15
16
17
# File 'app/models/pick_list/pick.rb', line 15

def order_options
  { study:, project: }
end