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 +4 -4
- data/README.md +1 -1
- data/docs/REVIEW_AND_PLAN.md +5 -4
- data/lib/active_windows/active_record_extensions.rb +3 -1
- data/lib/active_windows/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 997432adcf9a7b09e16440849eac9c1e2c5f740993d3a61e037bf425bd649be7
|
|
4
|
+
data.tar.gz: 13a7e599db4e091490e1597892400838e205548a2c750b3e0307dbc46b7ddf1f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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/
|
|
305
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/faraquet/active_windows.
|
|
306
306
|
|
|
307
307
|
## License
|
|
308
308
|
|
data/docs/REVIEW_AND_PLAN.md
CHANGED
|
@@ -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.
|
|
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. **
|
|
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(
|
|
157
|
+
).over(window).as(alias_name)
|
|
156
158
|
end
|
|
157
159
|
|
|
158
160
|
def apply_window_partition(window, partition)
|
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.
|
|
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/
|
|
126
|
+
homepage: https://github.com/faraquet/active_windows
|
|
127
127
|
licenses:
|
|
128
128
|
- MIT
|
|
129
129
|
metadata:
|
|
130
|
-
source_code_uri: https://github.com/
|
|
130
|
+
source_code_uri: https://github.com/faraquet/active_windows
|
|
131
131
|
rubygems_mfa_required: 'true'
|
|
132
132
|
rdoc_options: []
|
|
133
133
|
require_paths:
|