sql-jarvis 2.1.8 → 2.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2099c512441aaa437cc3a4738bfac47cae88945ac4005db3008f15631eab70aa
4
- data.tar.gz: 9732a29ee98755ccb4ece4699ffd5a236b3ddf75179d5bbaf14a83e51c1c073d
3
+ metadata.gz: ec2dab35b960fcb7b8e8e9f66403fbba3441edb57f44883bf32190d0a07c7c95
4
+ data.tar.gz: 3b30a74a600936ba7f86c39d9ae82c2ecb08df3113582ca2e3c0fffd02f72af8
5
5
  SHA512:
6
- metadata.gz: 28b166c53f77a1f2ac56b8c2395523514615dad78e24a49b6ea63c4a358244bbbdcf2410f617f47b5c1803bbbfca0f12b5688c26a11bf491e73d3cde4028b552
7
- data.tar.gz: 4bdb175e0dd852dfb3f6b35e731f5f9e9fded27236fdccde4b0db15888983b58789577b332c74d1e7fd5492df067a818b55e56dc913f7b64c3de522f8c51cf2a
6
+ metadata.gz: 2b2bac495e28c4033ee8e63784f4056ea4749fb783ec89e377c26d6714eeb8fabb3363fd57771ce2b801646475abc6689233f17fb52b3349bf077af334f541d5
7
+ data.tar.gz: f9a0974280ad528fa120e017b3a4aeb6eb71867e1d5da73aa306b5c0ffe5f05c51969b60f1614e9cf70491203edcfe7611d32ab171823017dcc4ced9bf89c7d8
@@ -1,7 +1,7 @@
1
1
  module Blazer
2
2
  class QueriesController < BaseController
3
3
  before_action :set_query, only: [:show, :edit, :update, :destroy, :refresh]
4
- before_action :set_data_source, only: [:new, :edit, :tables, :docs, :schema, :cancel, :columns]
4
+ before_action :set_data_source, only: [:new, :edit, :tables, :docs, :schema, :cancel, :columns, :update]
5
5
  before_action :set_accessible, only: [:new, :create, :show, :edit, :update, :destroy, :refresh]
6
6
 
7
7
  def home
@@ -296,7 +296,7 @@
296
296
  var $select = $("#table_names").selectize({})
297
297
  var selectize = $select[0].selectize
298
298
  selectize.on("change", function(val) {
299
- editor.setValue(previewStatement[_this.dataSource].replace("{table}", val), 1)
299
+ editor.setValue(previewStatement[_this.dataSource].replaceAll("{table}", val), 1)
300
300
  _this.run()
301
301
  selectize.clear(true)
302
302
  selectize.blur()
@@ -56,7 +56,7 @@ module Blazer
56
56
  elsif sqlserver?
57
57
  "SELECT TOP (30) * FROM {table}"
58
58
  else
59
- "SELECT *\nFROM {table}\nORDER BY id DESC\nLIMIT 30"
59
+ "SELECT *\nFROM {table}\nORDER BY {table}.id DESC\nLIMIT 30"
60
60
  end
61
61
  end
62
62
 
@@ -27,7 +27,8 @@ module Blazer
27
27
  end
28
28
 
29
29
  def save_file!
30
- tmp_file = Tempfile.new.path
30
+ file_name = "#{query.id}_#{Time.current.to_i}"
31
+ tmp_file = Tempfile.new([file_name, '.xlsx']).path
31
32
  excel.serialize(tmp_file)
32
33
  return tmp_file
33
34
  end
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = '2.1.8'
2
+ VERSION = '2.1.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql-jarvis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.8
4
+ version: 2.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-26 00:00:00.000000000 Z
11
+ date: 2024-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties