Explain what is Polymorphic Association in Ruby on Rails?
Explain what is Polymorphic Association in Ruby on Rails?
A polymorphic association in Ruby on Rails allows a model to belong to more than one other model on a single association. It is a type of Active Record association that provides a way to associate a model with multiple other models on a single association.
The key aspects of polymorphic associations are:
<model>_type and <model>_id to store the associated model name and id<model>_type column stores the class name of the associated objectCan you explain the difference between ActiveSupport’s HashWithIndifferentAccess and Ruby’s Hash ?
Xem chi tiếtDoes Ruby Support Single Inheritance/Multiple Inheritance Or Both?
Xem chi tiếtExplain how you define Instance Variable, Global Variable and Class Variable in Ruby?
Xem chi tiếtĐăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.