Guest User

Untitled

a guest
Oct 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ruby-1.9.2-p180 :008 > custom_form = CustomForm.last
  2. => #<CustomForm id: 20, html_page_id: nil, custom_form_type_id: 1, created_at: "2011-08-31 09:50:10", updated_at: "2011-08-31 09:50:10", status_id: 1>
  3. ruby-1.9.2-p180 :009 > custom_form_type = CustomFormType.last
  4. => #<CustomFormType id: 1, name: "gastenboek", mail_template_id: 1, mail_template_staff_id: 4, created_at: nil, updated_at: nil>
  5. ruby-1.9.2-p180 :010 > custom_form.custom_form_type
  6. => nil
  7. ruby-1.9.2-p180 :011 >
  8.  
  9.  
  10. ________________
  11. class CustomForm < ActiveRecord::Base
  12. belongs_to :html_page
  13. belongs_to :custom_form_type
  14. has_many :custom_form_values, :dependent => :destroy
  15.  
  16.  
  17. ________________
  18.  
  19. class CustomFormType < ActiveRecord::Base
  20. belongs_to :mail_template
  21. belongs_to :mail_template_staff, :class_name => "MailTemplate"
  22.  
  23. has_many :custom_forms
  24. has_many :custom_form_type_fields, :dependent => :destroy
  25. end
Add Comment
Please, Sign In to add comment