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



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

def project
  @project || extract_project_from_source_receptacle
end

#source_receptacleObject

Returns the value of attribute source_receptacle.



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

def source_receptacle
  @source_receptacle
end

#studyObject



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

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.



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

def user=(value)
  @user = value
end

Instance Method Details

#order_optionsObject

Used to help group compatible picks together into orders



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

def order_options
  { study:, project: }
end