Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/arfi/extensions/active_record/base.rb
Overview
:nodoc:
Class Method Summary collapse
-
.function_exists?(function_name) ⇒ Boolean
ActiveRecord::Base.function_exists?-> bool.
Class Method Details
.function_exists?(function_name) ⇒ Boolean
ActiveRecord::Base.function_exists? -> bool
This method checks if a custom SQL function exists in the database.
16 17 18 |
# File 'lib/arfi/extensions/active_record/base.rb', line 16 def self.function_exists?(function_name) connection.execute("SELECT * FROM pg_proc WHERE proname = '#{function_name}'").any? end |