I have a belongs_to with a foreign_key called obj_id in a model. The foreign key is set to an INT but when I do:
It returns:
#<Model:0x10f064d80 @_current_callback=nil @error=[], @new_record=false, @destroyed=false, @id=26, @obj_id=nil created_at=nil, updated_at=nil>
created at and updated at are also set in the database.
The model:
class Model < Granite::Base
connection pg
table models
belongs_to user : User, foreign_key: obj_id : Int32?
timestamps
end
I have a
belongs_towith aforeign_keycalledobj_idin a model. The foreign key is set to anINTbut when I do:It returns:
#<Model:0x10f064d80 @_current_callback=nil @error=[], @new_record=false, @destroyed=false, @id=26, @obj_id=nil created_at=nil, updated_at=nil>created at and updated at are also set in the database.
The model: