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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e12b39f79599cd0ee0824bd36c1dccc248af77f
4
- data.tar.gz: fcd42bc9f98f5d28e02088be3b61771c7f627ccf
3
+ metadata.gz: d1b16fe35bd81101c454ca2f2760bd1b218e7845
4
+ data.tar.gz: a14be735671766c73ac204e925030ff0adabe4af
5
5
  SHA512:
6
- metadata.gz: a862624f81082209bc850a0e033c124983e2f1d01bfdb093beace015a9272a15a5138b3eb0afc08ac0cfaafbac815b79a8da108e8d9115f2808fd0af08d2d130
7
- data.tar.gz: 4823cc44b1eaab551fcb820869b1a3f823ab17495c34583ba0c9f5b32a284a17f489e85ad36578734cab1b0d61baa0c012136b25825c1cf1fff82bff86742117
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" => [:locale, :data, :_destroy] } }
31
+ attrs.each_with_object([]) { |i, obj| obj << { "#{i}_translateable_attributes" => %i(locale data destroy) } }
31
32
  end
32
33
  end
33
34
 
@@ -1,3 +1,3 @@
1
1
  module Translateable
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.6'.freeze
3
3
  end
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.5
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-03-22 00:00:00.000000000 Z
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.8
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.