mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-25 14:19:56 -04:00
commit
a6d2c9db03
1 changed files with 3 additions and 5 deletions
|
@ -2,9 +2,6 @@ module Export
|
||||||
|
|
||||||
class SchemaArgumentsError < RuntimeError; end
|
class SchemaArgumentsError < RuntimeError; end
|
||||||
|
|
||||||
# TODO: Use yajl-ruby for performance.
|
|
||||||
# https://github.com/brianmario/yajl-ruby
|
|
||||||
|
|
||||||
class JsonEncoder
|
class JsonEncoder
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
@ -58,7 +55,8 @@ module Export
|
||||||
|
|
||||||
def finish
|
def finish
|
||||||
@schema_data[:schema][:table_count] = @table_data.keys.count
|
@schema_data[:schema][:table_count] = @table_data.keys.count
|
||||||
json_output_stream.write( @schema_data.merge(@table_data).to_json )
|
json_output_stream.write( Oj.dump(@schema_data.merge(@table_data),
|
||||||
|
:mode => :compat) )
|
||||||
json_output_stream.close
|
json_output_stream.close
|
||||||
|
|
||||||
@filenames = [File.join( tmp_directory, 'tables.json' )]
|
@filenames = [File.join( tmp_directory, 'tables.json' )]
|
||||||
|
@ -72,4 +70,4 @@ module Export
|
||||||
FileUtils.rm_rf(tmp_directory) if Dir[tmp_directory].present?
|
FileUtils.rm_rf(tmp_directory) if Dir[tmp_directory].present?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue