lib/hair_trigger/adapter.rb
def quote_table_name_in_trigger(definition)
      pattern = /
        (
          CREATE\sTRIGGER\s+
          \S+\s+
          (BEFORE|AFTER|INSTEAD\s+OF)\s+
          (INSERT|UPDATE|DELETE|TRUNCATE)\s+
          (OR\s+(INSERT|UPDATE|DELETE|TRUNCATE)\s+)*
          (ON\s+)
        )
        (\w+) # quote if not already quoted
      /ixm
      definition.sub(pattern, '\\1"\\7"')
    end
# a bit hacky, but we need to ensure the table name is always quoted
# on the way out, not just for reserved words. this is because we
# always quote on the way in, so we need them to match exactly
# when diffing
a bit hacky, but we need to ensure the table name is always quoted
on the way out, not just for reserved words. this is because we
always quote on the way in, so we need them to match exactly
when diffing
a bit hacky but we need to ensure the table name is always quoted on the way out not just for reserved words . this is because we always quote on the way in so we need them to match exactly when diffing
def quote_table_name_in_trigger(definition)
      pattern = /
        (
          CREATE\sTRIGGER\s+
          \S+\s+
          (BEFORE|AFTER|INSTEAD\s+OF)\s+
          (INSERT|UPDATE|DELETE|TRUNCATE)\s+
          (OR\s+(INSERT|UPDATE|DELETE|TRUNCATE)\s+)*
          (ON\s+)
        )
        (\w+) # quote if not already quoted
      /ixm
      definition.sub(pattern, '\\1"\\7"')
    end
def quote_table_name_in_trigger ( definition ) pattern = / 
        (
          CREATE \s TRIGGER \s +
           \S + \s +
          (BEFORE|AFTER|INSTEAD \s +OF) \s +
          (INSERT|UPDATE|DELETE|TRUNCATE) \s +
          (OR \s +(INSERT|UPDATE|DELETE|TRUNCATE) \s +)*
          (ON \s +)
        )
        ( \w +) # quote if not already quoted
       /ixm definition . sub ( pattern , '\\1"\\7"' ) end
a bit hacky, but we need to ensure the table name is always quoted
on the way out, not just for reserved words.
a bit hacky but we need to ensure the table name is always quoted on the way out not just for reserved words .
definition