I’m having a hard time explaining this, so I hope i can say this
correctly. I have these tables:
buildings id name room wtkeys id key_number key_way
My question is when i need to insert a new issued_key do I just do
person.fname = "Robert" person.lname = "Boone" person.save! dept = Department.new dept.name = "IT" dept.save! building = Building.new building.name = "CC" building.save! wtkey = Wtkey.new wtkey.key_number = "1234" wtkey.key_way = "AAAA" wtkey.save! issued_key = IssuedKey.new issued_key.people_id = person.id issued_key.department_id = dept.id issued_key.building_id = building.id issued_key.wtkey_id = wtkey.id issued_key.date_issued = Time.now issued_key.save!
This seems very un-rails-like to me (but I could be wrong). Is there
there a better way to do this. And I won’t object to changing the