Guest User

Untitled

a guest
Jun 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class IpInterface < Sequel::Model
  2.  
  3. many_to_one :layer3_interface, :key => :id
  4.  
  5. def before_save do
  6. if new?
  7. self.layer3_interface = Layer3Interface.new
  8. end
  9. end
  10. end
  11.  
  12. class Layer3Interface < Sequel::Model
  13. one_to_many :ip_interfaces, :one_to_one => true, :key => :id
  14. end
Add Comment
Please, Sign In to add comment