mongoid_i18n_embedded 0.0.2 → 0.0.3
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.
- data/Gemfile +3 -3
- data/lib/mongoid/i18n.rb +8 -6
- metadata +7 -7
data/Gemfile
CHANGED
|
@@ -2,9 +2,9 @@ source "http://rubygems.org"
|
|
|
2
2
|
|
|
3
3
|
group :development, :test do
|
|
4
4
|
gem "bson_ext"
|
|
5
|
-
gem "rails"
|
|
6
|
-
gem "capybara"
|
|
7
|
-
gem "rspec-rails"
|
|
5
|
+
gem "rails"
|
|
6
|
+
gem "capybara"
|
|
7
|
+
gem "rspec-rails"
|
|
8
8
|
gem "simplecov", :require => false
|
|
9
9
|
gem "factory_girl_rails"
|
|
10
10
|
gem "ffaker"
|
data/lib/mongoid/i18n.rb
CHANGED
|
@@ -27,6 +27,10 @@ module Mongoid
|
|
|
27
27
|
Mongoid::I18n.configuration.locales
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
def self.locale
|
|
31
|
+
::I18n.locale
|
|
32
|
+
end
|
|
33
|
+
|
|
30
34
|
module ClassMethods
|
|
31
35
|
def internationalized_field(name, options = {})
|
|
32
36
|
"#{self.name}::InternationalizedData".constantize.field name, options
|
|
@@ -54,12 +58,10 @@ module Mongoid
|
|
|
54
58
|
end
|
|
55
59
|
end
|
|
56
60
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
internationalized_data.build(:language => l.to_s)
|
|
62
|
-
end
|
|
61
|
+
def generates_internationalized_data
|
|
62
|
+
Mongoid::I18n.locales.each do |l|
|
|
63
|
+
if internationalized_data.where(:language => l.to_s).count < 1
|
|
64
|
+
internationalized_data.build(:language => l.to_s)
|
|
63
65
|
end
|
|
64
66
|
end
|
|
65
67
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mongoid_i18n_embedded
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -10,19 +10,19 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2012-04-12 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: mongoid
|
|
17
|
-
requirement: &
|
|
17
|
+
requirement: &2152309800 !ruby/object:Gem::Requirement
|
|
18
18
|
none: false
|
|
19
19
|
requirements:
|
|
20
|
-
- -
|
|
20
|
+
- - ~>
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
22
|
+
version: 2.4.8
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
|
-
version_requirements: *
|
|
25
|
+
version_requirements: *2152309800
|
|
26
26
|
description: This gem provides functionalities to manipulate internationalized data
|
|
27
27
|
using Mongoid.
|
|
28
28
|
email: contato@lucasrenan.com
|
|
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
57
57
|
version: '0'
|
|
58
58
|
requirements: []
|
|
59
59
|
rubyforge_project:
|
|
60
|
-
rubygems_version: 1.8.
|
|
60
|
+
rubygems_version: 1.8.16
|
|
61
61
|
signing_key:
|
|
62
62
|
specification_version: 3
|
|
63
63
|
summary: This gem provides functionalities to manipulate internationalized data using
|