Using :owner in Ruby on Rails -


sorry simple , maybe stupid quation.

in model have next line code:

belongs_to :owner, polymorphic: true 

i cant found in project model owner. owner in rails , how use it? can found more information this?

this association polymorphic. means in database have 2 columns: owner_id , owner_type, , in owner_type column have class name of associated model.

you can read more here:

http://guides.rubyonrails.org/association_basics.html#polymorphic-associations


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -