Files

Class Index [+]

Quicksearch

Ubiquo::Adapters::SchemaStatements

Public Class Methods

included(klass) click to toggle source

(Not documented)

   # File vendor/plugins/ubiquo_core/lib/ubiquo/adapters/schema_statements.rb, line 5
5:       def self.included(klass)
6:         klass.send(:alias_method_chain, :drop_table, :sequences)
7:       end

Public Instance Methods

add_sequence_field(table_name, field_name) click to toggle source

Undoes the field and sequence created by the SchemaStatements#sequence method

    # File vendor/plugins/ubiquo_core/lib/ubiquo/adapters/schema_statements.rb, line 28
28:       def add_sequence_field(table_name, field_name)
29:         change_table(table_name) do |t|
30:           t.sequence table_name, field_name
31:         end
32:       end
drop_table_with_sequences(table_name, options={}) click to toggle source

Performs the usual drop_table action, but remove also the created sequences that are related with this table

    # File vendor/plugins/ubiquo_core/lib/ubiquo/adapters/schema_statements.rb, line 11
11:       def drop_table_with_sequences(table_name, options={})
12:         drop_table_without_sequences(table_name, options)
13:         ActiveRecord::Base.connection.list_sequences(table_name.to_s + "_$").each do |sequence|
14:           unless sequence =~ /id_seq/ || options[:force]
15:             ActiveRecord::Base.connection.drop_sequence sequence
16:           end
17:         end
18:       end
remove_sequence_field(table_name, field_name) click to toggle source

Undoes the field and sequence created by the add_sequence_field method

    # File vendor/plugins/ubiquo_core/lib/ubiquo/adapters/schema_statements.rb, line 21
21:       def remove_sequence_field(table_name, field_name)
22:         change_table(table_name) do |t|
23:           t.remove_sequence table_name, field_name
24:         end
25:       end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.