easy_translatable 0.0.3 → 0.0.4

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: fd348d57198d754e5d34815c56e8ae1292350e9a
4
- data.tar.gz: 84c305960230028d2f17b146957afabb1236e4b6
3
+ metadata.gz: dcd641aad3b080b3e3227320945bdceb7344b62d
4
+ data.tar.gz: f1af1cbf318efb5a3b4d536bd8f4b39c351898b8
5
5
  SHA512:
6
- metadata.gz: b675700c42c9ccaa5a4897d479b75bb2d30c6de26a4ef009018c58f9c1999aea675e48bc63642cfdbf77a2ed257715aec8c7445511de4bcdba21eacfe2eb4698
7
- data.tar.gz: f22e844ac9e6260f1441c925e0697ffe3f1d57fe878dd3027775a55d32fb413679ed9d3fdb07153d243da7b0a21758835b16d470bda2f4431aa1e9cc2726d4d6
6
+ metadata.gz: 3c1d40a073ef3d8d550f301f7669aa8d958e463df1f6d9dd9920ff4bafea22dbc2827217a4c5e90942ae3037084a4807f09fa3560eda3f349af570f208bd7322
7
+ data.tar.gz: 67d46cc2a3762f396d9ee3c889bdb762bdb78d322ecc0bf2da54a6b9684a130a0eb2e0773b9956311f3624a3c9615ff429b1075d9062effcc3131d83a2e501d1
@@ -18,7 +18,6 @@ module Translatable
18
18
  to_translate.each do |attr|
19
19
 
20
20
  if is_in_scope? attr
21
- p "in_scope? attr : #{is_in_scope? attr}"
22
21
  index += 1
23
22
  if Translatable::Config.list[model].include?(attr.to_s)
24
23
  q = q.joins("LEFT JOIN snippets sn#{index} ON sn#{index}.record_id = #{model}.id AND sn#{index}.scope = '#{model}' AND sn#{index}.group_id = #{model}.group_id AND sn#{index}.lang = '#{lang}' AND sn#{index}.key = '#{attr}'").
@@ -46,7 +45,13 @@ module Translatable
46
45
  def is_in_scope?(attr)
47
46
 
48
47
  if has_select_values?
49
- select_values = self.scoped.select_values
48
+ select_values = self.scoped.select_values.map { |one|
49
+ if one.is_a?(String)
50
+ one.split(',').map(&:lstrip).map(&:rstrip)
51
+ else
52
+ one
53
+ end
54
+ }.flatten
50
55
  select_values.select{ |value| value.is_a?(String) && value.split('.').last == '*' }.length > 0 ||
51
56
  select_values.include?(attr) ||
52
57
  select_values.include?(attr.to_sym) ||
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_translatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Bonaud