class Specimen::BaseQuery

Overview

所属する採集行

Included Modules

Direct Known Subclasses

Defined in:

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor Detail

def self.all : self #

Class Method Detail

def self.any? : Bool #
Description copied from module Enumerable(Specimen)

Returns true if at least one of the collection's members is truthy.

[nil, true, 99].any? # => true
[nil, false].any?    # => false
([] of Int32).any?   # => false
  • #present? does not consider truthiness of elements.
  • #any?(&) and #any(pattern) allow custom conditions.

NOTE #any? usually has the same semantics as #present?. They only differ if the element type can be falsey (i.e. T <= Nil || T <= Pointer || T <= Bool). It's typically advised to prefer #present? unless these specific truthiness semantics are required.


def self.find(id) : T #

def self.first : T #
Description copied from module Enumerable(Specimen)

Returns the first element in the collection. Raises Enumerable::EmptyError if the collection is empty.

([1, 2, 3]).first   # => 1
([] of Int32).first # raises Enumerable::EmptyError

def self.first? : T | Nil #
Description copied from module Enumerable(Specimen)

Returns the first element in the collection. When the collection is empty, returns nil.

([1, 2, 3]).first?   # => 1
([] of Int32).first? # => nil

def self.last : T #

def self.last? : T | Nil #

def self.new_with_existing_query(query : Avram::QueryBuilder) #

def self.none? : Bool #
Description copied from module Enumerable(Specimen)

Returns true if all of the elements of the collection are falsey.

[nil, false].none?       # => true
[nil, false, true].none? # => false

It's the opposite of all?.


def self.preload_collect_point_info(record : Specimen, force : Bool = false) : Specimen #

def self.preload_collect_point_info(record : Specimen, force : Bool = false, &) : Specimen #

def self.preload_collect_point_info(record : Specimen, preload_query : CollectPoint::BaseQuery, force : Bool = false) : Specimen #

def self.preload_collect_point_info(records : Enumerable(Specimen), force : Bool = false) : Array(Specimen) #

def self.preload_collect_point_info(records : Enumerable(Specimen), force : Bool = false, &) : Array(Specimen) #

def self.preload_collect_point_info(records : Enumerable(Specimen), preload_query : CollectPoint::BaseQuery, force : Bool = false) : Array(Specimen) #

def self.preload_collection_settings_info(record : Specimen, force : Bool = false) : Specimen #

def self.preload_collection_settings_info(record : Specimen, force : Bool = false, &) : Specimen #

def self.preload_collection_settings_info(record : Specimen, preload_query : CollectionSetting::BaseQuery, force : Bool = false) : Specimen #

def self.preload_collection_settings_info(records : Enumerable(Specimen), force : Bool = false) : Array(Specimen) #

def self.preload_collection_settings_info(records : Enumerable(Specimen), force : Bool = false, &) : Array(Specimen) #

def self.preload_collection_settings_info(records : Enumerable(Specimen), preload_query : CollectionSetting::BaseQuery, force : Bool = false) : Array(Specimen) #

def self.preload_custom_taxon_info(record : Specimen, force : Bool = false) : Specimen #

def self.preload_custom_taxon_info(record : Specimen, force : Bool = false, &) : Specimen #

def self.preload_custom_taxon_info(record : Specimen, preload_query : Taxon::BaseQuery, force : Bool = false) : Specimen #

def self.preload_custom_taxon_info(records : Enumerable(Specimen), force : Bool = false) : Array(Specimen) #

def self.preload_custom_taxon_info(records : Enumerable(Specimen), force : Bool = false, &) : Array(Specimen) #

def self.preload_custom_taxon_info(records : Enumerable(Specimen), preload_query : Taxon::BaseQuery, force : Bool = false) : Array(Specimen) #

def self.preload_default_taxon_info(record : Specimen, force : Bool = false) : Specimen #

def self.preload_default_taxon_info(record : Specimen, force : Bool = false, &) : Specimen #

def self.preload_default_taxon_info(record : Specimen, preload_query : Taxon::BaseQuery, force : Bool = false) : Specimen #

def self.preload_default_taxon_info(records : Enumerable(Specimen), force : Bool = false) : Array(Specimen) #

def self.preload_default_taxon_info(records : Enumerable(Specimen), force : Bool = false, &) : Array(Specimen) #

def self.preload_default_taxon_info(records : Enumerable(Specimen), preload_query : Taxon::BaseQuery, force : Bool = false) : Array(Specimen) #

def self.preload_tour(record : Specimen, force : Bool = false) : Specimen #

def self.preload_tour(record : Specimen, force : Bool = false, &) : Specimen #

def self.preload_tour(record : Specimen, preload_query : Tour::BaseQuery, force : Bool = false) : Specimen #

def self.preload_tour(records : Enumerable(Specimen), force : Bool = false) : Array(Specimen) #

def self.preload_tour(records : Enumerable(Specimen), force : Bool = false, &) : Array(Specimen) #

def self.preload_tour(records : Enumerable(Specimen), preload_query : Tour::BaseQuery, force : Bool = false) : Array(Specimen) #

def self.truncate(*, cascade : Bool = false, restart_identity : Bool = false) #

Removes all data from a table using the TRUNCATE postgres SQL command.

You should run this command with cascade: true if your table columns are referenced by other foreign key constraints. Use delete instead if you don't want to accidentally delete rows referenced elsewhere.

To delete all data referenced by foreign keys as well, set cascade to true.


Macro Detail

macro generate_criteria_method(name, type) #

Instance Method Detail

def allow_kojin_shuzo(value) #

def allow_kojin_shuzo #

def clone #

Returns a copy of self with all instance variables cloned.


def collect_point_info_id(value) #

def collect_point_info_id #

def collecter(value) #

def collecter #

def collection_code(value) #

def collection_code #

def collection_settings_info_id(value) #

def collection_settings_info_id #

def custom_taxon_info_id(value) #

def custom_taxon_info_id #

def date_identified(value) #

def date_identified #

def date_last_modified(value) #

def date_last_modified #

def day(value) #

def day #

def default_taxon_info_id(value) #

def default_taxon_info_id #

def disposition(value) #

def disposition #

def establishment_means(value) #

def establishment_means #

def find(id) : T #

def full_join_collect_point_info #

def full_join_collection_settings_info #

def full_join_custom_taxon_info #

def full_join_default_taxon_info #

def full_join_tour #

def id(value) #

def id #

def identified_by(value) #

def identified_by #

def image1(value) #

def image1 #

def image2(value) #

def image2 #

def image3(value) #

def image3 #

def image4(value) #

def image4 #

def image5(value) #

def image5 #

def inner_join_collect_point_info #

def inner_join_collection_settings_info #

def inner_join_custom_taxon_info #

def inner_join_default_taxon_info #

def inner_join_tour #

def join_collect_point_info #

def join_collection_settings_info #

def join_custom_taxon_info #

def join_default_taxon_info #

def join_tour #

def left_join_collect_point_info #

def left_join_collection_settings_info #

def left_join_custom_taxon_info #

def left_join_default_taxon_info #

def left_join_tour #

def lifestage(value) #

def lifestage #

def month(value) #

def month #

def note(value) #

def note #

def preload_collect_point_info(preload_query : CollectPoint::BaseQuery) : self #

def preload_collect_point_info : self #

def preload_collect_point_info(&) : self #

def preload_collection_settings_info(preload_query : CollectionSetting::BaseQuery) : self #

def preload_collection_settings_info : self #

def preload_collection_settings_info(&) : self #

def preload_custom_taxon_info(preload_query : Taxon::BaseQuery) : self #

def preload_custom_taxon_info : self #

def preload_custom_taxon_info(&) : self #

def preload_default_taxon_info(preload_query : Taxon::BaseQuery) : self #

def preload_default_taxon_info : self #

def preload_default_taxon_info(&) : self #

def preload_tour(preload_query : Tour::BaseQuery) : self #

def preload_tour : self #

def preload_tour(&) : self #

def preparation_type(value) #

def preparation_type #

def published_kojin_shuzo(value) #

def published_kojin_shuzo #

def right_join_collect_point_info #

def right_join_collection_settings_info #

def right_join_custom_taxon_info #

def right_join_default_taxon_info #

def right_join_tour #

def rights(value) #

def rights #

def sampling_effort(value) #

def sampling_effort #

def sampling_protocol(value) #

def sampling_protocol #

def sex(value) #

def sex #

def tour_id(value) #

def tour_id #

def update(id : UUID | Avram::Nothing = IGNORE, date_last_modified : Time | Avram::Nothing = IGNORE, user_id : Int32 | Avram::Nothing | Nil = IGNORE, collection_code : Int32 | Avram::Nothing = IGNORE, identified_by : String | Avram::Nothing = IGNORE, date_identified : Time | Avram::Nothing = IGNORE, collecter : String | Avram::Nothing = IGNORE, year : Int32 | Avram::Nothing = IGNORE, month : Int32 | Avram::Nothing = IGNORE, day : Int32 | Avram::Nothing = IGNORE, sex : String | Avram::Nothing = IGNORE, preparation_type : String | Avram::Nothing = IGNORE, disposition : String | Avram::Nothing = IGNORE, sampling_protocol : String | Avram::Nothing = IGNORE, sampling_effort : String | Avram::Nothing = IGNORE, lifestage : String | Avram::Nothing = IGNORE, establishment_means : String | Avram::Nothing = IGNORE, rights : String | Avram::Nothing = IGNORE, custom_taxon_info_id : Taxon::PrimaryKeyType | Avram::Nothing | Nil = IGNORE, default_taxon_info_id : Taxon::PrimaryKeyType | Avram::Nothing | Nil = IGNORE, collect_point_info_id : CollectPoint::PrimaryKeyType | Avram::Nothing | Nil = IGNORE, collection_settings_info_id : CollectionSetting::PrimaryKeyType | Avram::Nothing | Nil = IGNORE, tour_id : Tour::PrimaryKeyType | Avram::Nothing | Nil = IGNORE, note : String | Avram::Nothing = IGNORE, allow_kojin_shuzo : Bool | Avram::Nothing = IGNORE, published_kojin_shuzo : Bool | Avram::Nothing = IGNORE, image1 : String | Avram::Nothing | Nil = IGNORE, image2 : String | Avram::Nothing | Nil = IGNORE, image3 : String | Avram::Nothing | Nil = IGNORE, image4 : String | Avram::Nothing | Nil = IGNORE, image5 : String | Avram::Nothing | Nil = IGNORE) : Int64 #
Description copied from module Avram::Queryable(Specimen)

Update the records using the query's where clauses, or all records if no wheres are added.

Returns the number of records updated as Int64.

# Update all comments with the word "spam" as spam
CommentQuery.new.body.ilike("spam").update(spam: true)

def user_id(value) #

def user_id #

def where_collect_point_info(assoc_query : CollectPoint::BaseQuery, auto_inner_join : Bool = true) #

def where_collection_settings_info(assoc_query : CollectionSetting::BaseQuery, auto_inner_join : Bool = true) #

def where_custom_taxon_info(assoc_query : Taxon::BaseQuery, auto_inner_join : Bool = true) #

def where_default_taxon_info(assoc_query : Taxon::BaseQuery, auto_inner_join : Bool = true) #

def where_tour(assoc_query : Tour::BaseQuery, auto_inner_join : Bool = true) #

def year(value) #

def year #