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/statements/trigger.rb,
lib/fx/statements/function.rb,
lib/fx/schema_dumper/trigger.rb,
lib/fx/schema_dumper/function.rb,
lib/fx/command_recorder/trigger.rb,
lib/fx/command_recorder/function.rb,
lib/fx/adapters/postgres/triggers.rb,
lib/fx/command_recorder/arguments.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.
3 4 5 |
# File 'lib/fx/configuration.rb', line 3 def self.configuration @_configuration ||= Configuration.new end |
.configuration=(config) ⇒ Object
Set F(x)'s configuration
10 11 12 |
# File 'lib/fx/configuration.rb', line 10 def self.configuration=(config) @_configuration = config end |
.configure {|config| ... } ⇒ Object
23 24 25 |
# File 'lib/fx/configuration.rb', line 23 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.
40 41 42 |
# File 'lib/fx.rb', line 40 def self.database configuration.database end |
.load ⇒ Object
Hooks Fx into Rails.
Enables fx migration methods, migration reversability, and schema.rb
dumping.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fx.rb', line 19 def self.load ActiveRecord::Migration::CommandRecorder.send( :include, Fx::CommandRecorder ) ActiveRecord::SchemaDumper.send( :prepend, Fx::SchemaDumper ) ActiveRecord::ConnectionAdapters::AbstractAdapter.send( :include, Fx::Statements ) end |