class DbCompile::Trigger

Public Instance Methods

build_path() click to toggle source
# File lib/dbcompile/trigger.rb, line 3
def build_path
  @path = File.join('triggers', "#{name}.sql")
end
verify() click to toggle source
# File lib/dbcompile/trigger.rb, line 7
def verify
  sql = nil
  case ActiveRecord::Base.connection.class.to_s
    when 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter'
      sql = "SELECT * FROM pg_trigger WHERE tgname = '#{name}';"
  end
  does_one_exist?(sql)
end