active_windows 0.1.0 → 0.1.2

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: c506ec36f11ce9b82beab86a0f574479965825dfd347eca6f46274111db50f08
4
- data.tar.gz: bd81dd06b95ed05826d6b56daa294ec6396d31e0f800e42a3c68783fed72ef59
3
+ metadata.gz: 997432adcf9a7b09e16440849eac9c1e2c5f740993d3a61e037bf425bd649be7
4
+ data.tar.gz: 13a7e599db4e091490e1597892400838e205548a2c750b3e0307dbc46b7ddf1f
5
5
  SHA512:
6
- metadata.gz: 7dfc6256cdaf8c2770f0ab59763de4a81552fe7a283b3852fe9bcb6d6d12f427709e5bf9e8ae999bee456761647ba7100ed191b2e5da2e3a808511d12935168e
7
- data.tar.gz: b19cc5ad7f5bb62752ec2c64060230cff28582317cee5e9c5a95b065f9c31ce613c8f15a07ef0294786664dfe553db971cd79ca731e413d611ee34057c4f6f97
6
+ metadata.gz: 28680757fe01be911b248555904c9569576b39e5fd743dc715e710ef1cf79609a82b543ca25ed975e6d3bc85157c15795df915d5732ad44aa799bf466a55b8bb
7
+ data.tar.gz: 7db21e9e9f36be6fd1f2db12e5fb3e999e1fa5dd588b8b5567e0fd3a19d21c8c5d4805ab21ee19e5747dc6cea3c8ecccfdce55fccab595bf339b494ddbe33326
data/README.md CHANGED
@@ -302,7 +302,7 @@ DB_ADAPTER=mysql2 MYSQL_DB=active_windows_test bundle exec rake test
302
302
 
303
303
  ## Contributing
304
304
 
305
- Bug reports and pull requests are welcome on GitHub at https://github.com/andreiandriichuk/active_windows.
305
+ Bug reports and pull requests are welcome on GitHub at https://github.com/faraquet/active_windows.
306
306
 
307
307
  ## License
308
308
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overall Assessment
4
4
 
5
- The gem provides a fluent DSL for SQL window functions in ActiveRecord. Core functionality is implemented and tested, with 16 window functions available via both fluent and hash APIs. 53 tests passing with 242 assertions.
5
+ The gem provides a fluent DSL for SQL window functions in ActiveRecord. Core functionality is implemented and tested, with 16 window functions available via both fluent and hash APIs. 67 tests passing with 328 assertions. CI runs against SQLite, PostgreSQL, and MySQL.
6
6
 
7
7
  ---
8
8
 
@@ -31,6 +31,9 @@ The gem provides a fluent DSL for SQL window functions in ActiveRecord. Core fun
31
31
  - ~~**Cross-platform lockfile**~~ — Fixed. Added `aarch64-linux`, `arm-linux`, `arm64-darwin`, `x86_64-darwin`, `x86_64-linux` platforms.
32
32
  - ~~**Multiple window functions in one call**~~ — Tested. Single `window()` with multiple keys and chaining separate `window()` calls both work.
33
33
  - ~~**Edge case tests**~~ — Added. Empty result sets, single-row partitions, NULL values in partition/order/value columns, chaining with `.joins()`, `.includes()`, `.where()` + `.joins()`. 67 tests, 328 assertions.
34
+ - ~~**PostgreSQL CI**~~ — Added. GitHub Actions workflow tests against PostgreSQL 17 with service container.
35
+ - ~~**MySQL CI**~~ — Added. GitHub Actions workflow tests against MySQL 8.0 with service container.
36
+ - ~~**MySQL compatibility**~~ — Fixed. Aliases now use `klass.connection.quote_column_name` to properly quote reserved words (e.g., `rank`) with backticks on MySQL and double quotes on PostgreSQL/SQLite. Test assertions use adapter-agnostic `q()` and `col()` helpers.
34
37
 
35
38
  ---
36
39
 
@@ -42,6 +45,4 @@ The gem provides a fluent DSL for SQL window functions in ActiveRecord. Core fun
42
45
 
43
46
  2. **GitHub Actions for gem publishing** — No automated release workflow.
44
47
 
45
- 3. **PostgreSQL test coverage** — SQLite has limited window function support. Testing against PostgreSQL would catch more issues.
46
-
47
- 4. **Input validation on function arguments** — `lag`, `lead`, `ntile`, `nth_value` accept arbitrary values without type checking (e.g., `ntile("abc")` won't raise until query execution).
48
+ 3. **Input validation on function arguments** — `lag`, `lead`, `ntile`, `nth_value` accept arbitrary values without type checking (e.g., `ntile("abc")` won't raise until query execution).
@@ -149,10 +149,12 @@ module ActiveWindows
149
149
 
150
150
  expressions = extract_window_value(options[:value])
151
151
 
152
+ alias_name = klass.connection.quote_column_name((options[:as] || name).to_s)
153
+
152
154
  Arel::Nodes::NamedFunction.new(
153
155
  name.to_s.upcase,
154
156
  expressions
155
- ).over(window).as((options[:as] || name).to_s)
157
+ ).over(window).as(alias_name)
156
158
  end
157
159
 
158
160
  def apply_window_partition(window, partition)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveWindows
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Andriichuk
@@ -123,11 +123,11 @@ files:
123
123
  - lib/active_windows/active_record_extensions.rb
124
124
  - lib/active_windows/railtie.rb
125
125
  - lib/active_windows/version.rb
126
- homepage: https://github.com/andreiandriichuk/active_windows
126
+ homepage: https://github.com/faraquet/active_windows
127
127
  licenses:
128
128
  - MIT
129
129
  metadata:
130
- source_code_uri: https://github.com/andreiandriichuk/active_windows
130
+ source_code_uri: https://github.com/faraquet/active_windows
131
131
  rubygems_mfa_required: 'true'
132
132
  rdoc_options: []
133
133
  require_paths: