class DbCompile::Function

Public Instance Methods

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