Module: Fx
- Defined in:
- lib/fx.rb,
lib/fx/railtie.rb,
lib/fx/trigger.rb,
lib/fx/version.rb,
lib/generators.rb,
lib/fx/function.rb,
lib/fx/definition.rb,
lib/fx/statements.rb,
lib/fx/configuration.rb,
lib/fx/schema_dumper.rb,
lib/fx/command_recorder.rb,
lib/fx/adapters/postgres.rb,
lib/fx/adapters/postgres/triggers.rb,
lib/fx/adapters/postgres/functions.rb,
lib/fx/adapters/postgres/connection.rb,
lib/generators/fx/trigger/trigger_generator.rb,
lib/generators/fx/function/function_generator.rb
Overview
F(x) adds methods ActiveRecord::Migration
to create and manage database
triggers and functions in Rails applications.
Defined Under Namespace
Modules: Adapters, Generators Classes: Configuration, Railtie
Class Method Summary collapse
-
.configuration ⇒ Fx::Configuration
F(x)'s current configuration.
-
.configuration=(config) ⇒ Object
Set F(x)'s configuration.
-
.configure {|config| ... } ⇒ Object
Modify F(x)'s current configuration.
-
.database ⇒ Object
The current database adapter used by F(x).
-
.load ⇒ Object
Hooks Fx into Rails.
Class Method Details
.configuration ⇒ Fx::Configuration
Returns F(x)'s current configuration.
30 31 32 |
# File 'lib/fx.rb', line 30 def self.configuration @_configuration ||= Configuration.new end |
.configuration=(config) ⇒ Object
Set F(x)'s configuration
37 38 39 |
# File 'lib/fx.rb', line 37 def self.configuration=(config) @_configuration = config end |
.configure {|config| ... } ⇒ Object
50 51 52 |
# File 'lib/fx.rb', line 50 def self.configure yield configuration end |
.database ⇒ Object
The current database adapter used by F(x).
This defaults to Fx::Adapters::Postgres but can be overridden via Configuration.
58 59 60 |
# File 'lib/fx.rb', line 58 def self.database configuration.database end |
.load ⇒ Object
Hooks Fx into Rails.
Enables fx migration methods, migration reversability, and schema.rb
dumping.
21 22 23 24 25 26 27 |
# File 'lib/fx.rb', line 21 def self.load ActiveRecord::Migration::CommandRecorder.include(Fx::CommandRecorder) ActiveRecord::ConnectionAdapters::AbstractAdapter.include(Fx::Statements) ActiveRecord::SchemaDumper.prepend(Fx::SchemaDumper) true end |