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


4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/api/model_extensions/submission.rb', line 4

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