active_type 1.8.0 → 1.9.0

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: d14a09e976ff66dc4b1ead8c7f30cd4e81b226b005a296d65ee81770b140899a
4
- data.tar.gz: 391c56642e084ef358af0bcb68909f512823db84e640d3b97e61efe0bce71c21
3
+ metadata.gz: 21de85e1b19fed7dd547f3301c82ec967997b7fed1d8b063b674e15f538bcc49
4
+ data.tar.gz: 3e8b54eb5b1573b0d3284e7f6c216099d165b44c485f8881226a99447d78c18a
5
5
  SHA512:
6
- metadata.gz: a924ce52a863ab2dbf8f1e0e40da9e8c4083f5a4f1bf3215ed44740471dc2ba8498066b9ace3a93c201cc8a2a078f5abf2ccb2816a7486f57e2cffa1b128703e
7
- data.tar.gz: 3a3937c2815c14a432645559d87588a0ae3a6d07ee8f451ed6882e825978a391d96f109ff5f8fe1d20aebf3c87c5d952fd7aa999fe22cfd88f56a4d9d198ae37
6
+ metadata.gz: 04dc0427781f01314b7535b97bca3d002489ec9db45e6231e428e050d732c80d70ef07a1300e4dc8ba306aa3e3ea55ab124a7b6245c1928ed0909b24df798d2d
7
+ data.tar.gz: ebd393afc5b781ef4fd2edb3951b6d7c50ba691687c2c0a52ec76fbe013b9756776e61f4a655d3ce6221ed148c8aefff9d1cf770d95669f98102069affa67b72
data/CHANGELOG.md CHANGED
@@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## Unreleased changes
6
6
 
7
+ ## 1.9.0 (2021-05-20)
8
+
9
+ * Fixed: Extended records now use their own I18n namespace when looking up translations for models or attributes.
10
+ (introduced in [1.4.0](https://github.com/makandra/active_type/commit/b2aa4247ed1d45a4cd7e51e13d945cba7c38c597))
11
+
12
+ There was an issue ([#142](https://github.com/makandra/active_type/issues/142)) when extending an already extended records again. Now the I18n lookup will fall back
13
+ fall back correctly to the extended record's or even the base record's namespace.
14
+
7
15
  ## 1.8.0 (2021-04-27)
8
16
 
9
- * Fixed: When casting an unsaved record, the new record will have the same associations as the base record.
17
+ * Added: When casting an unsaved record, the new record will have the same associations as the base record.
10
18
 
11
19
  ## 1.7.0 (2021-04-27)
12
20
 
data/Gemfile CHANGED
@@ -1 +1 @@
1
- ./Gemfile.5.2.pg
1
+ Gemfile.5.2.pg
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (1.8.0)
4
+ active_type (1.9.0)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  rspec (~> 3.4)
57
57
 
58
58
  BUNDLED WITH
59
- 2.1.4
59
+ 2.2.16
data/Gemfile.5.2.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (1.8.0)
4
+ active_type (1.9.0)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (1.8.0)
4
+ active_type (1.9.0)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (1.8.0)
4
+ active_type (1.9.0)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
data/Gemfile.6.1.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (1.8.0)
4
+ active_type (1.9.0)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (1.8.0)
4
+ active_type (1.9.0)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
data/Gemfile.lock CHANGED
@@ -1 +1 @@
1
- ./Gemfile.5.2.pg.lock
1
+ Gemfile.5.2.pg.lock
@@ -34,13 +34,13 @@ module ActiveType
34
34
  namespace = module_ancestors.detect do |n|
35
35
  n.respond_to?(:use_relative_model_naming?) && n.use_relative_model_naming?
36
36
  end
37
- # We create a Name object, with the parent class name, but self as the @klass reference
37
+ # We create a Name object, with the sti class name, but self as the @klass reference
38
38
  # This way lookup_ancestors is invoked on the right class instead of the extended_record_base_class
39
- dup_model_name = ActiveModel::Name.new(self, namespace, extended_record_base_class.name)
40
- key = name.underscore
41
- # We fake the `i18n_key` to lookup on the derived class key
39
+ dup_model_name = ActiveModel::Name.new(self, namespace, sti_name)
40
+ key = name.underscore.to_sym
41
+ # We set the `i18n_key` to lookup on the derived class key
42
42
  # We keep the others the same to preserve parameter and route names
43
- dup_model_name.define_singleton_method(:i18n_key) { key }
43
+ dup_model_name.instance_variable_set(:@i18n_key, key)
44
44
  dup_model_name
45
45
  else # name is nil for the anonymous intermediate class
46
46
  extended_record_base_class.model_name
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '1.8.0'
2
+ VERSION = '1.9.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_type
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-27 00:00:00.000000000 Z
12
+ date: 2021-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.1.4
130
+ rubygems_version: 3.2.17
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Make any Ruby object quack like ActiveRecord