class Specimen

Included Modules

Defined in:

models/specimen.cr

Constant Summary

ASSOCIATIONS = [{type: Taxon, assoc_name: custom_taxon_info, foreign_key: :custom_taxon_info_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}, {type: Taxon, assoc_name: default_taxon_info, foreign_key: :default_taxon_info_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}, {type: CollectPoint, assoc_name: collect_point_info, foreign_key: :collect_point_info_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}, {type: CollectionSetting, assoc_name: collection_settings_info, foreign_key: :collection_settings_info_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}, {type: Tour, assoc_name: tour, foreign_key: :tour_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}] of Nil
COLUMNS = [{name: id, type: UUID, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: date_last_modified, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: user_id, type: Int32, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: collection_code, type: Int32, nilable: false, autogenerated: false, value: 0, serialized: false, allow_blank: false}, {name: identified_by, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: date_identified, type: Time, nilable: false, autogenerated: false, value: Time.local, serialized: false, allow_blank: false}, {name: collecter, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: year, type: Int32, nilable: false, autogenerated: false, value: 0, serialized: false, allow_blank: false}, {name: month, type: Int32, nilable: false, autogenerated: false, value: 0, serialized: false, allow_blank: false}, {name: day, type: Int32, nilable: false, autogenerated: false, value: 0, serialized: false, allow_blank: false}, {name: sex, type: String, nilable: false, autogenerated: false, value: "U", serialized: false, allow_blank: true}, {name: preparation_type, type: String, nilable: false, autogenerated: false, value: "dry specimens", serialized: false, allow_blank: true}, {name: disposition, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: sampling_protocol, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: sampling_effort, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: lifestage, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: establishment_means, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: rights, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: custom_taxon_info_id, type: Taxon::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: default_taxon_info_id, type: Taxon::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: collect_point_info_id, type: CollectPoint::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: collection_settings_info_id, type: CollectionSetting::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: tour_id, type: Tour::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: note, type: String, nilable: false, autogenerated: false, value: "", serialized: false, allow_blank: true}, {name: allow_kojin_shuzo, type: Bool, nilable: false, autogenerated: false, value: false, serialized: false, allow_blank: false}, {name: published_kojin_shuzo, type: Bool, nilable: false, autogenerated: false, value: false, serialized: false, allow_blank: false}, {name: image1, type: String, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: image2, type: String, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: image3, type: String, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: image4, type: String, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: image5, type: String, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}] of Nil
PRIMARY_KEY_NAME = :id
PRIMARY_KEY_TYPE = UUID

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor methods inherited from class BaseModel

new(rs : DB::ResultSet) new

Class methods inherited from class BaseModel

database : Avram::Database.class database, from_rs(rs : DB::ResultSet) from_rs

Macros inherited from class BaseModel

default_columns default_columns

Constructor Detail

def self.new(id : UUID, date_last_modified : Time, user_id : Int32 | Nil, collection_code : Int32, identified_by : String, date_identified : Time, collecter : String, year : Int32, month : Int32, day : Int32, sex : String, preparation_type : String, disposition : String, sampling_protocol : String, sampling_effort : String, lifestage : String, establishment_means : String, rights : String, custom_taxon_info_id : UUID | Nil, default_taxon_info_id : UUID | Nil, collect_point_info_id : UUID | Nil, collection_settings_info_id : UUID | Nil, tour_id : UUID | Nil, note : String, allow_kojin_shuzo : Bool, published_kojin_shuzo : Bool, image1 : Nil | String, image2 : Nil | String, image3 : Nil | String, image4 : Nil | String, image5 : Nil | String) #

def self.new(rs : DB::ResultSet) #

Class Method Detail

def self.column_names : Array(Symbol) #

def self.columns : Array(NamedTuple(name: Symbol, nilable: Bool, type: String)) #

def self.ensure_correct_column_mappings! #

def self.from_rs(rs : DB::ResultSet) #

def self.primary_key_name : Symbol | Nil #

[View source]
def self.schema_enforcer_validations #

def self.table_name : String #

Macro Detail

macro default_columns #

[View source]

Instance Method Detail

def allow_kojin_shuzo : Bool #

def allow_kojin_shuzo? : Bool #

def base_query_class : ::Specimen::BaseQuery.class #

This makes it easy for plugins and extensions to use the base SaveOperation


def collect_point_info : CollectPoint | Nil #

採集地点情報


def collect_point_info! : CollectPoint | Nil #

採集地点情報


def collect_point_info_count : Int64 #

採集地点情報


def collect_point_info_id : CollectPoint::PrimaryKeyType | Nil #

def collect_point_info_preloaded? : Bool #

採集地点情報


def collect_point_info_query #

def collecter : String #

def collection_code : Int32 #

def collection_settings_info : CollectionSetting | Nil #

コレクション設定情報


def collection_settings_info! : CollectionSetting | Nil #

コレクション設定情報


def collection_settings_info_count : Int64 #

コレクション設定情報


def collection_settings_info_id : CollectionSetting::PrimaryKeyType | Nil #

def collection_settings_info_preloaded? : Bool #

コレクション設定情報


def collection_settings_info_query #

def custom_taxon_info : Taxon | Nil #

以上でGBIFベースのカラム定義終了 以下はオリジナルの定義 カスタム分類情報


def custom_taxon_info! : Taxon | Nil #

以上でGBIFベースのカラム定義終了 以下はオリジナルの定義 カスタム分類情報


def custom_taxon_info_count : Int64 #

以上でGBIFベースのカラム定義終了 以下はオリジナルの定義 カスタム分類情報


def custom_taxon_info_id : Taxon::PrimaryKeyType | Nil #

def custom_taxon_info_preloaded? : Bool #

以上でGBIFベースのカラム定義終了 以下はオリジナルの定義 カスタム分類情報


def custom_taxon_info_query #

def date_identified : Time #

def date_last_modified : Time #

def day : Int32 #

def default_taxon_info : Taxon | Nil #

デフォルト分類情報


def default_taxon_info! : Taxon | Nil #

デフォルト分類情報


def default_taxon_info_count : Int64 #

デフォルト分類情報


def default_taxon_info_id : Taxon::PrimaryKeyType | Nil #

def default_taxon_info_preloaded? : Bool #

デフォルト分類情報


def default_taxon_info_query #

def delete_operation_class : ::Specimen::DeleteOperation.class #

def disposition : String #

def establishment_means : String #

def id : UUID #

def identified_by : String #

def image1 : String | Nil #

def image2 : String | Nil #

def image3 : String | Nil #

def image4 : String | Nil #

def image5 : String | Nil #

def lifestage : String #

def month : Int32 #

def note : String #

def preparation_type : String #

def published_kojin_shuzo : Bool #

def published_kojin_shuzo? : Bool #

def rights : String #

def sampling_effort : String #

def sampling_protocol : String #

def save_operation_class : ::Specimen::SaveOperation.class #

def sex : String #

def tour : Tour | Nil #

所属する採集行


def tour! : Tour | Nil #

所属する採集行


def tour_count : Int64 #

所属する採集行


def tour_id : Tour::PrimaryKeyType | Nil #

def tour_preloaded? : Bool #

所属する採集行


def tour_query #

def user_id : Int32 | Nil #

def year : Int32 #