Method: GoodData::Project#delete_all_data

Defined in:
lib/gooddata/models/project.rb

#delete_all_data(options = {}) ⇒ Array

Helper for getting rid of all data in the project

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :force (Boolean)

    has to be added otherwise the operation is not performed

Returns:

  • (Array)

    Result of executing MAQLs

[View source]

1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/gooddata/models/project.rb', line 1035

def delete_all_data(options = {})
  return false unless options[:force]
  begin
    datasets.reject(&:date_dimension?).pmap(&:delete_data)
  rescue MaqlExecutionError => e
    # This is here so that we do not throw out exceptions on synchornizing date dimensions
    # Currently there is no reliable way how to tell it is a date dimension
    fail e unless GoodData::Helpers.interpolate_error_messages(e.data['wTaskStatus']['messages']) == ["Internal error [handle_exception, hide_internal]."]
  end
end