mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
31 lines
615 B
Ruby
31 lines
615 B
Ruby
|
module Import
|
||
|
module Adapter
|
||
|
class Base
|
||
|
|
||
|
def self.register(opts={})
|
||
|
Import.add_import_adapter self, opts[:version], opts[:tables]
|
||
|
@table_names = opts[:tables]
|
||
|
end
|
||
|
|
||
|
def apply_to_column_names(table_name, column_names)
|
||
|
up_column_names(table_name, column_names)
|
||
|
end
|
||
|
|
||
|
def apply_to_row(table_name, row)
|
||
|
up_row(table_name, row)
|
||
|
end
|
||
|
|
||
|
|
||
|
# Implement the following methods in subclasses:
|
||
|
|
||
|
def up_column_names(table_name, column_names)
|
||
|
column_names
|
||
|
end
|
||
|
|
||
|
def up_row(table_name, row)
|
||
|
row
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|