Class: Dina::BaseModel
- Inherits:
-
JsonApiClient::Resource
- Object
- JsonApiClient::Resource
- Dina::BaseModel
show all
- Includes:
- JsonApiClient::Helpers::Callbacks
- Defined in:
- lib/dina/models/base_model.rb
Direct Known Subclasses
AcquisitionEvent, Assemblage, Attachment, CollectingEvent, CollectingMethod, Collection, CollectionSequenceGenerator, Derivative, Identifier, Institution, ManagedAttribute, MaterialSample, ObjectStore, ObjectStoreManagedAttribute, ObjectSubtype, Organism, Organization, Person, PreparationMethod, PreparationType, Project, Protocol, StorageUnit, StorageUnitType, Transaction, User
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
18
19
20
|
# File 'lib/dina/models/base_model.rb', line 18
def self.
{ content_type: "application/vnd.api+json", authorization: Dina::Authentication. }
end
|
.endpoint_path ⇒ Object
11
12
|
# File 'lib/dina/models/base_model.rb', line 11
def self.endpoint_path
end
|
.find_by_group(group, page: 1, per: 50) ⇒ Object
22
23
24
|
# File 'lib/dina/models/base_model.rb', line 22
def self.find_by_group(group, page: 1, per: 50)
self.where("group.groupName": group).page(page).per(per)
end
|
Instance Method Details
#english_description ⇒ Object
26
27
28
29
30
|
# File 'lib/dina/models/base_model.rb', line 26
def english_description
if self.respond_to?(:multilingualDescription)
multilingualDescription[:descriptions].select{|o| o[:lang] == "en"}.first[:desc]
end
end
|
#french_description ⇒ Object
32
33
34
35
36
|
# File 'lib/dina/models/base_model.rb', line 32
def french_description
if self.respond_to?(:multilingualDescription)
multilingualDescription[:descriptions].select{|o| o[:lang] == "fr"}.first[:desc]
end
end
|