def self.primary_key_name : Symbol | Nil
#
class OrderItem
- OrderItem
- BaseModel
- Avram::Model
- Reference
- Object
Included Modules
- Avram::PrimaryKeyMethods
- DB::Mappable
Defined in:
models/order_item.crConstant Summary
-
ASSOCIATIONS =
[{type: Store, assoc_name: store, foreign_key: :store_id, relationship_type: :belongs_to, through: nil}, {type: Good, assoc_name: good, foreign_key: :good_id, relationship_type: :belongs_to, through: nil}] of Nil
-
COLUMNS =
[{name: id, type: Int32, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: created_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: updated_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: store_id, type: Store::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: good_id, type: Good::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: order_type, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: order_id, type: Int32, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: price, type: Float64, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: weight_of_packaged_items, type: Float64, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: amount, type: Int16, nilable: false, autogenerated: false, value: nil, serialized: false}] of Nil
-
PRIMARY_KEY_NAME =
:id
-
PRIMARY_KEY_TYPE =
Int32
Constructors
- .new(id : Int32, created_at : Time, updated_at : Time, store_id : Int32 | Nil, good_id : Int32 | Nil, order_type : String, order_id : Int32, price : PG::Numeric, weight_of_packaged_items : PG::Numeric, amount : Int16)
- .new(__temp_297 : DB::ResultSet)
Class Method Summary
- .column_names : Array(Symbol)
- .columns : Array(NamedTuple(name: Symbol, nilable: Bool, type: String))
- .ensure_correct_column_mappings!
- .from_rs(__temp_297 : DB::ResultSet)
- .primary_key_name : Symbol | Nil
- .schema_enforcer_validations
- .table_name : String
Instance Method Summary
- #_order_preloaded? : Bool
- #_preloaded_order : StoreOrder | UserOrder | Nil
- #amount : Int16
- #amount=(_amount : Int16::Lucky::ColumnType)
-
#base_query_class : ::OrderItem::BaseQuery.class
This makes it easy for plugins and extensions to use the base SaveOperation
- #created_at : Time
- #created_at=(_created_at : Time::Lucky::ColumnType)
- #delete_operation_class : ::OrderItem::DeleteOperation.class
- #good : Good | Nil
- #good! : Good | Nil
- #good_count : Int64
- #good_id : Good::PrimaryKeyType | Nil
- #good_id=(_good_id : Good::PrimaryKeyType::Lucky::ColumnType | Nil)
- #good_query
- #id : Int32
- #id=(_id : Int32::Lucky::ColumnType)
- #order : StoreOrder | UserOrder
-
#order! : StoreOrder | UserOrder
Based on avram/src/avram/associations.cr, define_public_preloaded_getters
- #order_id : Int32
- #order_id=(_order_id : Int32::Lucky::ColumnType)
- #order_type : String
- #order_type=(_order_type : String::Lucky::ColumnType)
- #price : Float64
- #price=(_price : PG::Numeric)
- #save_operation_class : ::OrderItem::SaveOperation.class
- #set_preloaded_order(record : StoreOrder | UserOrder | Nil)
- #store : Store | Nil
- #store! : Store | Nil
- #store_count : Int64
- #store_id : Store::PrimaryKeyType | Nil
- #store_id=(_store_id : Store::PrimaryKeyType::Lucky::ColumnType | Nil)
- #store_query
- #updated_at : Time
- #updated_at=(_updated_at : Time::Lucky::ColumnType)
- #weight_of_packaged_items : Float64
- #weight_of_packaged_items=(_weight_of_packaged_items : PG::Numeric)
Class methods inherited from class BaseModel
database : Avram::Database.class
database
Constructor Detail
def self.new(id : Int32, created_at : Time, updated_at : Time, store_id : Int32 | Nil, good_id : Int32 | Nil, order_type : String, order_id : Int32, price : PG::Numeric, weight_of_packaged_items : PG::Numeric, amount : Int16)
#
Class Method Detail
Instance Method Detail
This makes it easy for plugins and extensions to use the base SaveOperation
Based on avram/src/avram/associations.cr, define_public_preloaded_getters