Skip to content

Business intelligence made simple

Added default name for forks

Andrew57c5cb020a4f
diff --git a/app/controllers/blazer/queries_controller.rb b/app/controllers/blazer/queries_controller.rb
index 5399ac6a..de0359bf 100644
--- a/app/controllers/blazer/queries_controller.rb
+++ b/app/controllers/blazer/queries_controller.rb
@@ -12,7 +12,11 @@ module Blazer
end
def new
- @query = Blazer::Query.new(statement: params[:statement], data_source: params[:data_source])
+ @query = Blazer::Query.new(
+ statement: params[:statement],
+ data_source: params[:data_source],
+ name: params[:name]
+ )
end
def create
diff --git a/app/views/blazer/queries/show.html.erb b/app/views/blazer/queries/show.html.erb
index bfc00039..912b11d0 100644
--- a/app/views/blazer/queries/show.html.erb
+++ b/app/views/blazer/queries/show.html.erb
@@ -25,7 +25,7 @@
</div>
<div class="col-sm-3 text-right">
<%= link_to "Edit", edit_query_path(@query, variable_params), class: "btn btn-default" %>
- <%= link_to "Fork", new_query_path(variable_params.merge(statement: @query.statement, data_source: @query.data_source)), class: "btn btn-info" %>
+ <%= link_to "Fork", new_query_path(variable_params.merge(statement: @query.statement, data_source: @query.data_source, name: "Fork of #{@query.name}")), class: "btn btn-info" %>
<% if !@error && @success %>
<%= button_to "Download", run_queries_path(statement: @statement, query_id: @query.id, format: "csv"), class: "btn btn-primary" %>