has_setting 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/has_setting/ar_extensions.rb +1 -1
- data/lib/has_setting/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd273ff228a9458fcbf258477f6bf309a67b1d8
|
4
|
+
data.tar.gz: d04409c08792279490a8e2df7b42a9b8a4be874e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dff3dd2c4471a1fa7d3106d09348c2ac93de4ae2cc089ff07138e942bba08d4700f4732a195f3b528499af5894a3146cc3ba7321887ee9b21ae3bae41d17ceb7
|
7
|
+
data.tar.gz: f6d45f3ea98d6a69c10301b7dc8d9581e9e4ba88dfb56139dc85dcc0a6b1cafa7a23f8dfe52473ab12b8a5f65a66ad3535ddbaeb3f6c9d49f0062fe6816db5af
|
@@ -64,7 +64,7 @@ module HasSetting
|
|
64
64
|
def read_setting(name)
|
65
65
|
# use detect instead of SQL find. like this the 'cached' has_many-collection is inited
|
66
66
|
# only once
|
67
|
-
locale = localize?(name) ? I18n.locale.to_s :
|
67
|
+
locale = localize?(name) ? I18n.locale.to_s : ""
|
68
68
|
s = self.settings.detect() {|item| item.name == name and item.locale.to_s == locale} # first see if there is a setting with current locale
|
69
69
|
s ||= self.settings.detect() {|item| item.name == name} # then if not found, take the first setting with matching name (TODO: add locale fallbacks)
|
70
70
|
s
|
data/lib/has_setting/version.rb
CHANGED