active_type 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/Gemfile +1 -1
- data/Gemfile.5.2.mysql2.lock +2 -2
- data/Gemfile.5.2.pg.lock +1 -1
- data/Gemfile.5.2.sqlite3.lock +1 -1
- data/Gemfile.6.0.sqlite3.lock +1 -1
- data/Gemfile.6.1.pg.lock +1 -1
- data/Gemfile.6.1.sqlite3.lock +1 -1
- data/Gemfile.lock +1 -1
- data/lib/active_type/record_extension/inheritance.rb +5 -5
- data/lib/active_type/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: 21de85e1b19fed7dd547f3301c82ec967997b7fed1d8b063b674e15f538bcc49
|
4
|
+
data.tar.gz: 3e8b54eb5b1573b0d3284e7f6c216099d165b44c485f8881226a99447d78c18a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
*
|
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
|
-
|
1
|
+
Gemfile.5.2.pg
|
data/Gemfile.5.2.mysql2.lock
CHANGED
data/Gemfile.5.2.pg.lock
CHANGED
data/Gemfile.5.2.sqlite3.lock
CHANGED
data/Gemfile.6.0.sqlite3.lock
CHANGED
data/Gemfile.6.1.pg.lock
CHANGED
data/Gemfile.6.1.sqlite3.lock
CHANGED
data/Gemfile.lock
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
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
|
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,
|
40
|
-
key = name.underscore
|
41
|
-
# We
|
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.
|
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
|
data/lib/active_type/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|