releaf-i18n_database 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/releaf/i18n_database/backend.rb +5 -0
- data/spec/lib/releaf/i18n_database/backend_spec.rb +14 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aba07692990a73c4d506094d544e388dc4eadf78
|
4
|
+
data.tar.gz: 31efe421e396cf876e74b3dc32ec2a8beebfa866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81b9f34b47e55f0babbe104ebf47b74afd8245608a9054efdeac3e011c4103a87f9fa6b06b54759e873cd3f4ea9032cab73290f26675959757efd7ac4a3e44d7
|
7
|
+
data.tar.gz: 233fb4145d4ce45acd3e53f16ed5c5649475525f3a958ff199d620e94ea1b67579eace23af5e63386850be262899aeaaa5856abc4265b3614c03cc5561011316
|
@@ -88,6 +88,11 @@ module Releaf
|
|
88
88
|
translations.missing(locale, key, options) if result.nil?
|
89
89
|
|
90
90
|
result
|
91
|
+
# As localization can be used in routes and as routes is loaded also when running `rake db:create`
|
92
|
+
# we want to supress those errors and silently return nil as developer/user will get database errors
|
93
|
+
# anyway when call to models will be made (let others do this)
|
94
|
+
rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid
|
95
|
+
nil
|
91
96
|
end
|
92
97
|
end
|
93
98
|
end
|
@@ -188,5 +188,19 @@ describe Releaf::I18nDatabase::Backend do
|
|
188
188
|
end
|
189
189
|
end
|
190
190
|
end
|
191
|
+
|
192
|
+
context "when database doesn't exists" do
|
193
|
+
it "returns an empty array" do
|
194
|
+
allow(Releaf::I18nDatabase::I18nEntry).to receive(:pluck).and_raise(ActiveRecord::NoDatabaseError.new("xxx"))
|
195
|
+
expect(subject.lookup(:lv, "some.localization", "_scope_", separator: ":", a: "b")).to be nil
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
context "when node table doesn't exist" do
|
200
|
+
it "returns an empty array" do
|
201
|
+
allow(Releaf::I18nDatabase::I18nEntry).to receive(:pluck).and_raise(ActiveRecord::StatementInvalid.new("xxx"))
|
202
|
+
expect(subject.lookup(:lv, "some.localization", "_scope_", separator: ":", a: "b")).to be nil
|
203
|
+
end
|
204
|
+
end
|
191
205
|
end
|
192
206
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: releaf-i18n_database
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CubeSystems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: releaf-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.
|
19
|
+
version: 1.0.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.
|
26
|
+
version: 1.0.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: twitter_cldr
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.5.1
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: i18n database gem for releaf
|