activerecord-refined 0.6.0 → 0.6.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: 7d179cda5b9633e349569aa64a129909938a377302ec7091d2dc342f1e809dc9
4
- data.tar.gz: 94cd9271298ee1b67e53ebe53c1f9a7b3ab5548e796f18d3bd2ec3e8ec24f320
3
+ metadata.gz: affe44abbced76ea15b8c057f44292e5aefb0c8be7bc0012805278b08be7881c
4
+ data.tar.gz: 54b11073068080d169b005a4f2fdee825a8b03e0910459c5fef5555e24430edd
5
5
  SHA512:
6
- metadata.gz: d4a032b8a00105c9f1d655e1cd745e2b2c66e4c10a1f0ca737451bd1f4dabf519227cf4c86f79d17f47340f7f26071f386fd5e88bf7488bb4de31513380178c5
7
- data.tar.gz: 42448bbad15330e96a8cb56760a463b17880256360d8f8f05684942ae758db148c24a3fb32c81c35bda840281265a21a120481aa9c5eaf3369d7b082ffc10e48
6
+ metadata.gz: 13103ed15da63fadedf60ec4f5f91ee0ba4c22440250aa9c7f48c9df2ccb0b72194225592ddf1dbca449d898fb33f5051fa30f906add9e533917c271b3b6283f
7
+ data.tar.gz: 97c9c10eeb67c3dbbbdd7e896e13eb4c49be50dd2312d92ee4289ab8a9c96d5159c06ea940f19a9871f33e877f71de8eb96c7d2d43399eb9097fd19505d4d35f
@@ -262,6 +262,7 @@ jobs:
262
262
  sandbox/index.html
263
263
  sandbox/boot.rb
264
264
  sandbox/examples.js
265
+ sandbox/pglite-bridge.mjs
265
266
  sandbox/manifest.json
266
267
  ${{ steps.r2url.outputs.served != 'true' && 'sandbox/ruby.wasm' || '' }}
267
268
  sandbox/rb
data/README.md CHANGED
@@ -15,8 +15,8 @@ Author.
15
15
  ```
16
16
 
17
17
  **[Try it in your browser](https://shugo.github.io/activerecord-refined/)** —
18
- Ruby 4.1, ActiveRecord and SQLite run in the page, so the examples build real
19
- SQL and return real rows without a `ruby-master` build of your own.
18
+ Ruby 4.1, ActiveRecord, SQLite and PostgreSQL run in the page, so the examples
19
+ build real SQL and return real rows without a `ruby-master` build of your own.
20
20
 
21
21
  ## History
22
22
 
@@ -15,10 +15,14 @@ module ActiveRecord
15
15
  # the mysql2 adapter and is counted with MySQL, though the two part
16
16
  # company over JSON. An adapter nobody has classified keeps the
17
17
  # standard spellings and is left to say for itself what it cannot do.
18
+ #
19
+ # pglite is PostgreSQL itself compiled to WebAssembly, reached through
20
+ # wasmify-rails' adapter; the server it answers for is the same one.
18
21
  ADAPTER_FAMILIES = {
19
22
  'sqlite3' => :sqlite,
20
23
  'postgresql' => :postgresql,
21
24
  'postgis' => :postgresql,
25
+ 'pglite' => :postgresql,
22
26
  'mysql2' => :mysql,
23
27
  'trilogy' => :mysql,
24
28
  }.freeze
@@ -1,5 +1,5 @@
1
1
  module Activerecord
2
2
  module Refined
3
- VERSION = '0.6.0'
3
+ VERSION = '0.6.1'
4
4
  end
5
5
  end
@@ -2228,4 +2228,31 @@ class TestBlockSyntax < Minitest::Test
2228
2228
  def test_numeric_shorthand_is_confined_to_the_block
2229
2229
  assert_raises(NoMethodError) { 0.as(:depth) }
2230
2230
  end
2231
+
2232
+ # pglite is PostgreSQL compiled to WebAssembly, which the sandbox runs in the
2233
+ # browser. Its adapter answers to a name of its own, so without this the
2234
+ # spellings would fall back to the standard ones and the browser would be
2235
+ # told PostgreSQL's JSON operators do not exist.
2236
+ def test_adapter_families
2237
+ model = Class.new do
2238
+ def self.with_adapter(name)
2239
+ config = Struct.new(:adapter).new(name)
2240
+ Class.new { define_singleton_method(:connection_db_config) { config } }
2241
+ end
2242
+ end
2243
+
2244
+ {
2245
+ 'sqlite3' => :sqlite,
2246
+ 'postgresql' => :postgresql,
2247
+ 'postgis' => :postgresql,
2248
+ 'pglite' => :postgresql,
2249
+ 'mysql2' => :mysql,
2250
+ 'trilogy' => :mysql,
2251
+ 'nothing_of_the_sort' => :unknown,
2252
+ }.each do |adapter, family|
2253
+ assert_equal(family,
2254
+ ActiveRecord::Refined::AST.adapter_family(model.with_adapter(adapter)),
2255
+ adapter)
2256
+ end
2257
+ end
2231
2258
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-refined
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda