Skip to content

Commit

Permalink
handle slug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike DeAngelo committed Aug 28, 2018
1 parent 6b8ca38 commit 5a53286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/gzr/commands/dashboard/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ def sync_dashboard(source,target_space_id)
if @options[:force] then
say_ok "Modifying existing dashboard #{existing_dashboard.id} #{existing_dashboard[:title]} in space #{target_space_id}"
new_dash = source.select do |k,v|
(keys_to_keep('update_dashboard') - [:space_id,:user_id,:title]).include? k
(keys_to_keep('update_dashboard') - [:space_id,:user_id,:title,:slug]).include? k
end
return update_dashboard(existing_dashboard.id,new_dash)
else
raise Gzr::CLI::Error, "Dashboard #{source[:title]} already exists in space #{target_space_id}\nUse --force if you want to overwrite it"
end
else
new_dash = source.select do |k,v|
(keys_to_keep('create_dashboard') - [:space_id,:user_id]).include? k
(keys_to_keep('create_dashboard') - [:space_id,:user_id,:slug]).include? k
end
new_dash[:space_id] = target_space_id
new_dash[:user_id] = @me.id
Expand Down
4 changes: 2 additions & 2 deletions lib/gzr/modules/look.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def upsert_look(user_id, query_id, space_id, source_look)
if @options[:force] then
say_ok "Modifying existing Look #{source_look[:title]} in space #{space_id}"
new_look = source_look.select do |k,v|
(keys_to_keep('update_look') - [:space_id,:user_id,:query_id]).include? k
(keys_to_keep('update_look') - [:space_id,:user_id,:query_id,:slug]).include? k
end
new_look[:query_id] = query_id
return update_look(existing_looks.first.id,new_look)
Expand All @@ -78,7 +78,7 @@ def upsert_look(user_id, query_id, space_id, source_look)
end
else
new_look = source_look.select do |k,v|
(keys_to_keep('create_look') - [:space_id,:user_id,:query_id]).include? k
(keys_to_keep('create_look') - [:space_id,:user_id,:query_id,:slug]).include? k
end
new_look[:query_id] = query_id
new_look[:user_id] = user_id
Expand Down

0 comments on commit 5a53286

Please sign in to comment.