class Mkxms::Mssql::ForeignKeyHandler
Public Class Methods
new(constraints, node)
click to toggle source
# File lib/mkxms/mssql/foreign_key_handler.rb, line 60 def initialize(constraints, node) a = node.attributes @relation = ForeignKey.new( a['schema'], a['table'], a['name'], on_delete: a['on-delete'], on_update: a['on-update'], enabled: !a['disabled'] ).tap do |k| constraints << k end end
Public Instance Methods
handle_link_element(parse)
click to toggle source
# File lib/mkxms/mssql/foreign_key_handler.rb, line 79 def handle_link_element(parse) a = parse.node.attributes @relation.links << [a['from'], a['to']] end
handle_referent_element(parse)
click to toggle source
# File lib/mkxms/mssql/foreign_key_handler.rb, line 73 def handle_referent_element(parse) a = parse.node.attributes @relation.references = [a['schema'], a['name']] end