everything. I have an idea to use Activerecord to implement something strange, as in the example below:
SystemInfo < ActiveRecord::Base belongs_to :SystemInfo end
The idea is that system A can contain system B as its child. Therefore, I will generate the application skeleton as:
script/generate scaffold SystemInfo parent_id:integer name:string
and then when I insert System A, I will use System A ID as System B parent_id (System A parent_id will be "nil" and when I use the command as follows:
sysA = SystemInfo.find_by_id(1)
I think itβs possible to get System A, and this is a child of System B. Similarly:
sysA.childrens
Could you offer me guidance for implementing this idea? I think this is a fairly common idea, and we should do it .;)
ruby ruby-on-rails activerecord
Teerasej
source share