para-i18n 0.2.0 → 0.2.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 +4 -4
- data/app/controllers/para/admin/translations_controller.rb +1 -1
- data/lib/para/i18n/model.rb +3 -1
- data/lib/para/i18n/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 104537a529924bef3f9c708314a568c72d8c9f0b
|
|
4
|
+
data.tar.gz: 4508e2afbe3804f117a654b23fc20b4f4fb37cae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63a6e793d7f8d857708a93036a7af5c57a2203598295a627aeae0ba3d8813b876e09434e3a1c4a71f20d5263b2056accbba8c39da2cb24d4dd093cf964ecbbb8
|
|
7
|
+
data.tar.gz: b9001dcc1a7901b3d600b445089f585c12a2357945bc57e2475c2e317796ea60d04cc09c1953d2198963524816faf4dcf3cbd6b997565f8d4944964bbe185a0f
|
|
@@ -28,7 +28,7 @@ module Para
|
|
|
28
28
|
options.merge!(
|
|
29
29
|
singleton: true,
|
|
30
30
|
through: :component
|
|
31
|
-
) unless params.key?(:resource_id)
|
|
31
|
+
) unless params.key?(:resource_id)
|
|
32
32
|
|
|
33
33
|
loader = self.class.cancan_resource_class.new(self, :resource, options)
|
|
34
34
|
loader.load_and_authorize_resource
|
data/lib/para/i18n/model.rb
CHANGED
|
@@ -5,6 +5,7 @@ module Para
|
|
|
5
5
|
|
|
6
6
|
included do
|
|
7
7
|
class_attribute :translated_attribute_names
|
|
8
|
+
class_attribute :translatable
|
|
8
9
|
end
|
|
9
10
|
|
|
10
11
|
def read_translated_attribute(field, locale = ::I18n.locale)
|
|
@@ -82,6 +83,7 @@ module Para
|
|
|
82
83
|
module ClassMethods
|
|
83
84
|
def translates(*fields)
|
|
84
85
|
self.translated_attribute_names = fields.map(&:to_sym)
|
|
86
|
+
self.translatable = true
|
|
85
87
|
|
|
86
88
|
fields.each do |field|
|
|
87
89
|
define_method field do
|
|
@@ -95,7 +97,7 @@ module Para
|
|
|
95
97
|
end
|
|
96
98
|
|
|
97
99
|
def translates?
|
|
98
|
-
|
|
100
|
+
translatable
|
|
99
101
|
end
|
|
100
102
|
end
|
|
101
103
|
end
|
data/lib/para/i18n/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: para-i18n
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Valentin Ballestrino
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-03-
|
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|