translateable 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/translateable.rb +2 -1
- data/lib/translateable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1b16fe35bd81101c454ca2f2760bd1b218e7845
|
4
|
+
data.tar.gz: a14be735671766c73ac204e925030ff0adabe4af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28488a5d4cf542fee24ea8246267531c0e7edf6cf4d7cff4204972b1023fc4cf9b3c63373af1fb245581a2fa2aa0eb1af8fe93de5df7faa04402b3cd46ac6f9a
|
7
|
+
data.tar.gz: 3324e2f02da2f5d54b5af8a894b22ac3ed48da169045db6d08bc5d8a41a3444f024da80163c881f856c63e77231a18b357f544faf5413a000801a2bd493d1e43
|
data/README.md
CHANGED
@@ -223,6 +223,10 @@ end
|
|
223
223
|
|
224
224
|
Refer to the [Postgres documentation](http://www.postgresql.org/docs/9.4/static/functions-json.html).
|
225
225
|
|
226
|
+
### Troubleshooting
|
227
|
+
|
228
|
+
If you're having problems with `translateable_sanity_check` you can disable those checks vie environment variable `DISABLE_TRANSLATEABLE_SANITY_CHECK=true`
|
229
|
+
|
226
230
|
## TODO
|
227
231
|
|
228
232
|
- Add options (fallback locales lookup behavior maybe?)
|
data/lib/translateable.rb
CHANGED
@@ -19,6 +19,7 @@ module Translateable
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def translateable_sanity_check(attr)
|
22
|
+
return if ENV['DISABLE_TRANSLATEABLE_SANITY_CHECK']
|
22
23
|
return unless database_connection_exists?
|
23
24
|
attr = attr.to_s
|
24
25
|
raise ArgumentError, "no such column '#{attr}' in '#{name}' model" unless column_names.include?(attr)
|
@@ -27,7 +28,7 @@ module Translateable
|
|
27
28
|
|
28
29
|
def define_translateable_strong_params(*attrs)
|
29
30
|
define_singleton_method('translateable_permitted_attributes') do
|
30
|
-
attrs.each_with_object([]) { |i, obj| obj << { "#{i}_translateable_attributes" =>
|
31
|
+
attrs.each_with_object([]) { |i, obj| obj << { "#{i}_translateable_attributes" => %i(locale data destroy) } }
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: translateable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Antonyan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
170
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.6.
|
171
|
+
rubygems_version: 2.6.11
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Allows to store text data in different languages.
|