Class: ActiveRecord::ConnectionAdapters::PostgreSQLFunctionAlterer
- Inherits:
-
PostgreSQLFunction
- Object
- PostgreSQLFunction
- ActiveRecord::ConnectionAdapters::PostgreSQLFunctionAlterer
- Defined in:
- lib/active_record/postgresql_extensions/functions.rb
Overview
Alters a function. You’ll generally want to be calling the PostgreSQLAdapter#alter_function method rather than risk messing with this class directly. It’s a finicky, delicate flower.
Instance Attribute Summary
Attributes inherited from PostgreSQLFunction
Instance Method Summary collapse
-
#empty? ⇒ Boolean
:nodoc:.
-
#initialize(base, name, args, options = {}) ⇒ PostgreSQLFunctionAlterer
constructor
:nodoc:.
-
#to_sql ⇒ Object
(also: #to_s)
:nodoc:.
Constructor Details
#initialize(base, name, args, options = {}) ⇒ PostgreSQLFunctionAlterer
:nodoc:
350 351 352 353 354 |
# File 'lib/active_record/postgresql_extensions/functions.rb', line 350 def initialize(base, name, args, = {}) #:nodoc: super(base, name, args, ) @sql = .collect { |k, v| build_statement(k, v) } end |
Instance Method Details
#empty? ⇒ Boolean
:nodoc:
356 357 358 |
# File 'lib/active_record/postgresql_extensions/functions.rb', line 356 def empty? #:nodoc: @sql.empty? end |
#to_sql ⇒ Object Also known as: to_s
:nodoc:
360 361 362 |
# File 'lib/active_record/postgresql_extensions/functions.rb', line 360 def to_sql #:nodoc: "#{@sql.join(";\n")};" end |