def primary_field
#
class Jennifer::Relation::BelongsTo(T, Q)
- Jennifer::Relation::BelongsTo(T, Q)
- Jennifer::Relation::Base(T, Q)
- Jennifer::Relation::IRelation
- Reference
- Object
Defined in:
jennifer/relation/belongs_to.crConstructors
Instance Method Summary
- #condition_clause(ids : Array(DBAny))
- #condition_clause(id : DBAny)
- #condition_clause
-
#foreign_field
Foreign key on T model side
- #insert(obj : Q, rel : Hash(String, T::AttrType))
- #insert(obj : Q, rel : T)
- #join_condition(query, type)
- #join_condition(query, type, &)
-
#preload_relation(collection, out_collection : Array(Model::Resource), pk_repo)
Preloads relation into collection from out_collection depending on keys from pk_repo.
- #primary_field
-
#query(primary_value_or_array)
Returns query for given primary field values
- #remove(obj : Q, rel : T)
- #remove(obj : Q)
Instance methods inherited from class Jennifer::Relation::Base(T, Q)
adapter
adapter,
condition_clause(ids : Array(DBAny))condition_clause(id : DBAny)
condition_clause condition_clause, foreign : String? foreign, foreign_field foreign_field, insert(obj : Q, rel : Hash(String, T::AttrType))
insert(obj : Q, rel : Hash(Symbol, T::AttrType))
insert(obj : Q, rel : T) insert, join_condition(query, type) join_condition, join_query : QueryBuilder::Condition | QueryBuilder::LogicOperator | Nil join_query, model_class model_class, name : String name, preload_relation(collection, out_collection : Array(Model::Resource), pk_repo) preload_relation, primary : String? primary, primary_field primary_field, query(primary_value_or_array) query, remove(obj : Q, rel : T) remove, table_name table_name, through : Symbol? through
Constructor methods inherited from class Jennifer::Relation::Base(T, Q)
new(name, foreign : String | Symbol?, primary : String | Symbol?, query : QueryBuilder::Query, through = nil)
new
Instance methods inherited from class Jennifer::Relation::IRelation
join_condition(a, b)
join_condition,
join_query
join_query,
model_class
model_class,
preload_relation(collection, out_collection : Array(Model::Resource), pk_repo)
preload_relation,
query(primary_value)
query,
table_name
table_name
Constructor Detail
Instance Method Detail
def foreign_field
#
Description copied from class Jennifer::Relation::Base(T, Q)
Foreign key on T model side
def preload_relation(collection, out_collection : Array(Model::Resource), pk_repo)
#
Description copied from class Jennifer::Relation::IRelation
Preloads relation into collection from out_collection depending on keys from pk_repo.
def query(primary_value_or_array)
#
Description copied from class Jennifer::Relation::IRelation
Returns query for given primary field values