hola_milind_patel 0.1.20 → 0.2.0

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
  SHA256:
3
- metadata.gz: bc644890c74fabdb14737fc019e36ef623429b60cb3e0f181606f0bcec31574a
4
- data.tar.gz: 28e54cc63ffa63273bf02df0b4ce537f38e0ffd4bb5d4fddd2ca167e22674610
3
+ metadata.gz: 9ae933213d39ff932f87a50c550127ba8f6942e483c13941e8053e11121b728e
4
+ data.tar.gz: 0f3350a004e42e0504a6d783c515f31f7331e23d1b3933d3d9ee1d5850e183e4
5
5
  SHA512:
6
- metadata.gz: 1a119b8ee23a8e08f8b0d127f858228ac0f10bfe7af98757adbca7f224f3b9bf88050049363b4f755fbf664dfe2b247161a2541ee32cf0e0c396a6f827cd6a08
7
- data.tar.gz: d9bdaa857263a08098e3a60e76da0e7190083b1d05f61e159adc90b090d9b6295016585f8849e3be855bb612f8d0016e93a16846078b49b15b59fdcf50222a8a
6
+ metadata.gz: 7de4d7db02ff1c7242453ada8c366a26129a9dd907c02903b628e5143f1eafa364bfc874583c4002990ae718522b2b592b5207a90d648cfeddbc183fd1f98082
7
+ data.tar.gz: 8f512cc3145642d8b9a13383b1b438d33270237e9995f49a3320fe6b9fe8ff13192a8b7c060e38c4a151899c943cfdb5e13571c93e3cd0ce32dcbbaebe4d156c
@@ -2,5 +2,5 @@ Mobility.configure do |config|
2
2
  config.default_backend = :key_value
3
3
  config.accessor_method = :translates
4
4
  config.query_method = :i18n
5
- config.default_options[:fallbacks] = true
5
+ config.default_options[:fallbacks] = false
6
6
  end
@@ -1,22 +1,25 @@
1
1
  require 'mobility'
2
2
  require 'config/hola_milind_patel'
3
3
  module HolaMilindPatel
4
-
5
- def translate_with_babeled_fish(data)
6
- # responce = getData(data) if !data[0].nil?
7
- responce = HolaMilindPatel.getShowData(data) #if data[0].nil?
4
+ def self.included(klass)
5
+ klass.after_find :translate_data
6
+ end
8
7
 
9
- data.attributes.each do |key,value|
10
- if (data.send("#{key}_backend") rescue "false") != "false"
11
- # data.short_title = responce[key] if key == "short_title"
12
- # data.description = responce[key] if key == "description"
8
+
9
+ def translate_data
10
+ result = HolaMilindPatel.translate(self)
11
+ self.attributes.each do |key,value|
12
+ if (self.send("#{key}_backend") rescue "false") != "false"
13
13
  data.send(key+'=', responce[key])
14
14
  end
15
15
  end
16
- return data
17
16
  end
18
17
 
19
-
18
+ def self.translate(data)
19
+ #responce = getData(data) if !data[0].nil?
20
+ responce = getShowData(data) if data[0].nil?
21
+ return responce
22
+ end
20
23
 
21
24
  # def self.getData(data)
22
25
  # if RequestStore.store[:selected_language] == "all"
@@ -95,5 +98,4 @@ module HolaMilindPatel
95
98
  RequestStore.store[:selected_language] = language
96
99
  HolaMilindPatel.locale = language == "all" ? I18n.default_locale : language
97
100
  end
98
-
99
101
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hola_milind_patel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Milind Patel