typed_uuid 2.2 → 2.3

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: f5bf0c87bdd7950cf4aa85e788d0e4d0ac49ac842947471b2788db6c5e7b347b
4
- data.tar.gz: a396047b9153d11c56ba87412ac7dbd6a3e17e9ecf701eebf9fef8e4542e9971
3
+ metadata.gz: 42ecd88d5a86ad89fe9a8c0cd8ec275bfded2d66ce7a7bd240f43184d0fe65ab
4
+ data.tar.gz: 2b32e8528b4d5dc750c54b8818ccb0fcbb99ea4d5276ece385d8af8f2f70c259
5
5
  SHA512:
6
- metadata.gz: 7e3fe8ade426da5a52beef42674a737ec22837b5c8d758155ee4f962ed81a054cf0a1e8d36c6122e2f4a6ea14db9c0bc88586351812eb8b859a4eeeb886af621
7
- data.tar.gz: 94434e3ab2d1fbb58a41c8dceb4558cf8a554ce16efd3b94aa9a0d62bde91b267da06804a91079076b1a88407e5cec362250a92146c8ac148ffe56ac0f83ebd2
6
+ metadata.gz: 2bacb4da4092347b9a483711e7e4530979bf2b135d03bc77f03599851463c21041dbef6b566c0ba6d151c1d2c516a4ca98caa150592888f2a3c85ec941dd060d
7
+ data.tar.gz: 7e4dd50dbd81e87934f04daf4bf94ed89f7bac9f024e23886bc3c401d626137de664aa8a8e087d02cb57f1193309159a5c6a97ac5b9258ab326c787669f427dc
@@ -15,4 +15,4 @@ class AddTypedUuidFunction < ActiveRecord::Migration[6.0]
15
15
  $$ LANGUAGE plpgsql;
16
16
  SQL
17
17
  end
18
- end
18
+ end
@@ -4,7 +4,7 @@ module TypedUUID::PsqlColumnMethods
4
4
  if type == :typed_uuid
5
5
  klass_enum = ::ActiveRecord::Base.uuid_type_from_table_name(self.name)
6
6
  options[:id] = :uuid
7
- options[:default] ||= -> { "typed_uuid('\\x#{klass_enum.to_s(16).ljust(4, '0')}')" }
7
+ options[:default] ||= -> { "typed_uuid('\\x#{klass_enum.to_s(16).rjust(4, '0')}')" }
8
8
  super(name, :uuid, **options)
9
9
  else
10
10
  super
@@ -1,3 +1,3 @@
1
1
  module TypedUUID
2
- VERSION = '2.2'
2
+ VERSION = '2.3'
3
3
  end
@@ -5,7 +5,7 @@ class FilterTest < ActiveSupport::TestCase
5
5
  schema do
6
6
  ActiveRecord::Base.register_uuid_types({
7
7
  listings: 0,
8
- buildings: 65_535
8
+ buildings: 592
9
9
  })
10
10
 
11
11
  create_table :listings, id: :typed_uuid do |t|
@@ -29,7 +29,7 @@ class FilterTest < ActiveSupport::TestCase
29
29
  })
30
30
 
31
31
  exprexted_sql = <<-SQL
32
- CREATE TABLE "properties" ("id" uuid DEFAULT typed_uuid('\\x1000') NOT NULL PRIMARY KEY, "name" character varying(255))
32
+ CREATE TABLE "properties" ("id" uuid DEFAULT typed_uuid('\\x0001') NOT NULL PRIMARY KEY, "name" character varying(255))
33
33
  SQL
34
34
 
35
35
  assert_sql exprexted_sql do
@@ -58,12 +58,12 @@ class FilterTest < ActiveSupport::TestCase
58
58
  test 'uuid_type from table_name' do
59
59
  assert_equal 0, ::ActiveRecord::Base.uuid_type_from_table_name(:listings)
60
60
  assert_equal 0, ::ActiveRecord::Base.uuid_type_from_table_name('listings')
61
- assert_equal 65_535, ::ActiveRecord::Base.uuid_type_from_table_name(:buildings)
61
+ assert_equal 592, ::ActiveRecord::Base.uuid_type_from_table_name(:buildings)
62
62
  end
63
63
 
64
64
  test 'class from uuid_type' do
65
65
  assert_equal FilterTest::Listing, ::ActiveRecord::Base.class_from_uuid_type(0)
66
- assert_equal FilterTest::Building, ::ActiveRecord::Base.class_from_uuid_type(65_535)
66
+ assert_equal FilterTest::Building, ::ActiveRecord::Base.class_from_uuid_type(592)
67
67
  end
68
68
 
69
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typed_uuid
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.2'
4
+ version: '2.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy