def primary : String
#
abstract class Jennifer::Relation::IPolymorphicBelongsTo
Defined in:
jennifer/relation/polymorphic_belongs_to.crConstant Summary
-
DEFAULT_PRIMARY_FIELD =
"id"
Constructors
Instance Method Summary
- #build(opts : Hash, polymorphic_type)
- #condition_clause(ids : Array(DBAny), polymorphic_type : String?)
- #condition_clause(id : DBAny, polymorphic_type : String?)
- #foreign : String
- #foreign_field : String
- #foreign_type : String
- #insert(obj : Model::Base, rel : Hash)
- #insert(obj : Model::Base, rel : Model::Base)
- #join_condition(query, type)
- #join_query
- #model_class
- #name : String
-
#preload_relation(collection, out_collection : Array(Jennifer::Model::Resource), pk_repo)
Preloads relation into collection from out_collection depending on keys from pk_repo.
- #primary : String
- #primary_field : String
- #query(id, polymorphic_type : Nil)
- #query(id, polymorphic_type : String)
-
#query(a)
Returns query for given primary field values
- #remove(obj : Model::Base)
- #table_name
Macro Summary
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
def self.new(name, foreign : String | Symbol?, primary : String | Symbol?, foreign_type : String | Symbol?)
#
Instance Method Detail
def preload_relation(collection, out_collection : Array(Jennifer::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(a)
#
Description copied from class Jennifer::Relation::IRelation
Returns query for given primary field values