Files

UbiquoI18n::SchemaDumper

This module performs the necessary steps to preserve the validity of an schema dump if, when creating a table, the :translatable option has been set

Public Class Methods

included(klass) click to toggle source

(Not documented)

   # File vendor/plugins/ubiquo_i18n/lib/ubiquo_i18n/schema_dumper.rb, line 5
5:     def self.included(klass)
6:       klass.send(:alias_method_chain, :table, :translations)
7:     end

Public Instance Methods

table_with_translations(table, stream) click to toggle source

(Not documented)

    # File vendor/plugins/ubiquo_i18n/lib/ubiquo_i18n/schema_dumper.rb, line 9
 9:     def table_with_translations(table, stream)
10:       tbl = StringIO.new
11:       table_without_translations(table, tbl)
12:       tbl.rewind
13:       result = tbl.read
14:       # The "integer" content_id field is in fact a sequence
15:       result.gsub!(/integer([\s]*) (\"content_id\")([^\n]*)/, ('sequence\1"'+table+'", \2'))
16:       stream.print result
17:     end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.