blazer 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26fc3acf3a9967fb5d4be9d0f8ebb76076343227a47bb9293eab6e60b4b2bcda
4
- data.tar.gz: 468eb44da7deffd9d826188d111e6ab292739e3e7a396778b6c623f4c7d52050
3
+ metadata.gz: 885d7856adf62794335bea7227c9d3f7047ca8c07bae46bb3ebe0e889433b4cf
4
+ data.tar.gz: e6943b3a9d84ad8fe818ff82ec167dfad16d00f9449c9429a7d05067fcbab48f
5
5
  SHA512:
6
- metadata.gz: 3455614272c734308c56afc122b98be8dbae766fb45b04a339b681c9ddb12ef9e2f3361d417ce9025afa189f5a8aa9307840f31a2de268f970b33fc1c3215a0d
7
- data.tar.gz: c2db32633b784143a51e46d9e316daf5df9c0b08b000921f47d9878d1e2d372e42ce08aba99c03c4c6a226d0d3db8633abb8c4e3fa06d73e3d76907adaa889ea
6
+ metadata.gz: 6cb9bdb7cafb7e4c6dff3e9a19e9c5c4450650fc69b805f84f041ab4fe2173982d349bd023fab6d395e36e324010aaed94606ec38c6fd384e1ebda33a0a7d27c
7
+ data.tar.gz: d17d30c3c3a816a26c16f2b6eb383acb94df09f162bb9e05f19d51e865a6efec8f01c5f376fcf6dfdb62814426b35934ac824d4c119ef0b5d84cd86a489779b5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.2.1 (2025-03-21)
2
+
3
+ - Added thousands separator to charts
4
+ - Improved i18n for charts
5
+ - Fixed leading zeros in variables
6
+
1
7
  ## 3.2.0 (2025-02-23)
2
8
 
3
9
  - Added support for Trino
data/README.md CHANGED
@@ -143,7 +143,7 @@ end
143
143
 
144
144
  ### Other
145
145
 
146
- Specify a `before_action` method to run in `blazer.yml`.
146
+ Specify a `before_action` method to run in `config/blazer.yml`.
147
147
 
148
148
  ```yml
149
149
  before_action_method: require_admin
@@ -231,7 +231,7 @@ SELECT * FROM users WHERE occupation_id = {occupation_id}
231
231
 
232
232
  Instead of remembering each occupation’s id, users can select occupations by name.
233
233
 
234
- Add a smart variable with:
234
+ Add a smart variable in `config/blazer.yml` with:
235
235
 
236
236
  ```yml
237
237
  smart_variables:
@@ -232,6 +232,9 @@ module Blazer
232
232
 
233
233
  def set_data_source
234
234
  @data_source = Blazer.data_sources[params[:data_source]]
235
+ rescue Blazer::Error => e
236
+ raise unless e.message.start_with?("Unknown data source:")
237
+ render plain: "Unknown data source", status: :not_found
235
238
  end
236
239
 
237
240
  def continue_run
@@ -4,7 +4,7 @@
4
4
  <% if @only_chart %>
5
5
  <p class="text-muted">Select variables</p>
6
6
  <% else %>
7
- <div class="alert alert-info">Can’t preview queries with variables...yet!</div>
7
+ <div class="alert alert-info">Can’t preview queries with variables</div>
8
8
  <% end %>
9
9
  <% elsif @cohort_analysis %>
10
10
  <% if @cohort_error %>
@@ -46,7 +46,7 @@
46
46
  <% chart_id = SecureRandom.hex %>
47
47
  <% column_types = @result.column_types %>
48
48
  <% chart_type = @result.chart_type %>
49
- <% chart_options = {id: chart_id} %>
49
+ <% chart_options = {id: chart_id, thousands: t("number.format.delimiter"), decimal: t("number.format.separator")} %>
50
50
  <% if ["line", "line2"].include?(chart_type) %>
51
51
  <% chart_options.merge!(min: nil) %>
52
52
  <% end %>
@@ -165,7 +165,7 @@
165
165
  <% end %>
166
166
  <% end %>
167
167
 
168
- <% if v2 = (@smart_values[k] || {})[v.nil? ? v : v.to_s] %>
168
+ <% if (v2 = @smart_values.dig(k, v&.to_s)) %>
169
169
  <div class="text-muted"><%= v2 %></div>
170
170
  <% end %>
171
171
  </td>
@@ -34,7 +34,10 @@ module Blazer
34
34
 
35
35
  unless value.is_a?(ActiveSupport::TimeWithZone)
36
36
  if value.match?(/\A\d+\z/)
37
- value = value.to_i
37
+ # check no leading zeros (when not zero)
38
+ if value == value.to_i.to_s
39
+ value = value.to_i
40
+ end
38
41
  elsif value.match?(/\A\d+\.\d+\z/)
39
42
  value = value.to_f
40
43
  end
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = "3.2.0"
2
+ VERSION = "3.2.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-23 00:00:00.000000000 Z
10
+ date: 2025-03-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: railties
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: '6.1'
32
+ version: '7'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '6.1'
39
+ version: '7'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: chartkick
42
42
  requirement: !ruby/object:Gem::Requirement