couch_i18n 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,14 @@
|
|
1
1
|
module CouchI18n
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
+
before_filter :authorize_user
|
3
4
|
layout 'couch_i18n/application'
|
5
|
+
|
6
|
+
private
|
7
|
+
|
8
|
+
def authorize_user
|
9
|
+
if respond_to?(:current_user) && current_user.present? && current_user.respond_to?(:is_admin) && !current_user.is_admin.present?
|
10
|
+
redirect_to '/', :alert => I18n.t('couch_i18n.general.not_authorized')
|
11
|
+
end
|
12
|
+
end
|
4
13
|
end
|
5
14
|
end
|
data/lib/couch_i18n.rb
CHANGED
@@ -63,4 +63,4 @@ module CouchI18n
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
# Now extend the I18n backend
|
66
|
-
I18n.backend = I18n::Backend::Chain.new(CouchI18n::Backend.new(CouchI18n::Store.new), I18n.backend)
|
66
|
+
I18n.backend = I18n::Backend::Chain.new(CouchI18n::Backend.new(CouchI18n::Store.new), I18n.backend) unless Rails.env == 'test'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couch_i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-03-08 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
16
|
-
requirement: &
|
16
|
+
requirement: &70227779264000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70227779264000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: simply_stored
|
27
|
-
requirement: &
|
27
|
+
requirement: &70227779263580 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70227779263580
|
36
36
|
description: couch_i18n is an in database storage for I18n translations, tested for
|
37
37
|
rails, with online management views
|
38
38
|
email: bterkuile@gmail.com
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project: couch_i18n
|
91
|
-
rubygems_version: 1.8.
|
91
|
+
rubygems_version: 1.8.15
|
92
92
|
signing_key:
|
93
93
|
specification_version: 3
|
94
94
|
summary: couch_i18n is an in database storage for I18n translations, tested for rails,
|