has_foreign_language 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/has_foreign_language.rb +3 -3
- metadata +24 -40
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a663d1e5a803a54e5494039dad27694f2d53d678
|
4
|
+
data.tar.gz: 8a2b77f4aff91fae4e51ae60b07d90e367a6af8b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bb90e7181a0706ef86e9a3a31eadb5c9a461aa78aab1ea286b3fd3b37fd05ccc0b5ea582bb09efcf6491435bb4f958e375384ec1715d6bb335589b243aa42648
|
7
|
+
data.tar.gz: b5977e532bd2b3e05c6227351f2b22018bc05c68648dfad6e142ad66294f583536909fd5a18838aeda08dec1fa35163614a42bffff3b46dbce7adfc3abb2d357
|
data/lib/has_foreign_language.rb
CHANGED
@@ -13,9 +13,9 @@ module Factore
|
|
13
13
|
define_method(field.to_s) do
|
14
14
|
if I18n.locale != I18n.default_locale && self.class.columns.select {|c| c.name == "#{field}_#{I18n.locale}"}.length > 0
|
15
15
|
result = self.send("#{field}_#{I18n.locale}".to_sym)
|
16
|
-
result.blank? ? super : self.send("#{field}_#{I18n.locale}".to_sym) #falling back to default if requested locale is nil
|
16
|
+
result.blank? ? super() : self.send("#{field}_#{I18n.locale}".to_sym) #falling back to default if requested locale is nil
|
17
17
|
else
|
18
|
-
super
|
18
|
+
super()
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -46,4 +46,4 @@ end
|
|
46
46
|
require 'form_fix'
|
47
47
|
if defined?(ActiveRecord::Base)
|
48
48
|
ActiveRecord::Base.send(:include, Factore::HasForeignLanguage)
|
49
|
-
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,65 +1,49 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_foreign_language
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Sean Roberts
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
date: 2012-04-11 00:00:00 -04:00
|
18
|
-
default_executable:
|
11
|
+
date: 2014-02-03 00:00:00.000000000 Z
|
19
12
|
dependencies: []
|
20
|
-
|
21
13
|
description: Easy database internationalization gem for Ruby on Rails
|
22
|
-
email:
|
14
|
+
email:
|
23
15
|
- sean@factore.ca
|
24
16
|
executables: []
|
25
|
-
|
26
17
|
extensions: []
|
27
|
-
|
28
18
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
files:
|
19
|
+
files:
|
31
20
|
- lib/form_fix.rb
|
32
21
|
- lib/has_foreign_language.rb
|
33
|
-
|
22
|
+
- spec/models/has_foreign_language_spec.rb
|
23
|
+
- spec/spec_helper.rb
|
34
24
|
homepage: http://github.com/factore/has_foreign_language
|
35
25
|
licenses: []
|
36
|
-
|
26
|
+
metadata: {}
|
37
27
|
post_install_message:
|
38
28
|
rdoc_options: []
|
39
|
-
|
40
|
-
require_paths:
|
29
|
+
require_paths:
|
41
30
|
- lib
|
42
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
segments:
|
54
|
-
- 0
|
55
|
-
version: "0"
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
56
41
|
requirements: []
|
57
|
-
|
58
42
|
rubyforge_project:
|
59
|
-
rubygems_version:
|
43
|
+
rubygems_version: 2.0.5
|
60
44
|
signing_key:
|
61
|
-
specification_version:
|
45
|
+
specification_version: 4
|
62
46
|
summary: Easy database internationalization gem for Ruby on Rails
|
63
|
-
test_files:
|
47
|
+
test_files:
|
64
48
|
- spec/models/has_foreign_language_spec.rb
|
65
49
|
- spec/spec_helper.rb
|