Module: ModelExtensions::Submission

Included in:
Submission
Defined in:
app/api/model_extensions/submission.rb

Overview

Included in Submission The intent of this file was to provide methods specific to the V1 API

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/api/model_extensions/submission.rb', line 5

def self.included(base)
  base.class_eval do
    scope :include_orders,
          lambda {
            includes(
              orders: {
                study: :uuid_object,
                project: :uuid_object,
                assets: [:uuid_object, { aliquots: Io::Aliquot::PRELOADS }]
              }
            )
          }

    def order
      orders.first
    end
  end
end