acts_as_localized 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e61f91e7f43ba936ce1197b55e20a86cff2c1c44
4
- data.tar.gz: 2dee242adebaef517a527f3ce3a3e8322ef81a04
3
+ metadata.gz: 7cdd5e0db66bba1dca59e9c6e855781b4a7d72ea
4
+ data.tar.gz: bd6fd761d5a83ed38c452d2522f670ddc13f1f99
5
5
  SHA512:
6
- metadata.gz: ea47429a00a574b7259298c37edbf3039fd58a1ba0c5299cb7990ba36fcc0f36beea735a0093c3d6e499ef3a23090e8b21a524e967a35b1b0abfd956b159ab37
7
- data.tar.gz: ed117e78a096a95290ab3428fc90084984204d2ee836cbcfa272ac7536c0aea7ac1e6630d844176a104c8ae0d24f448d3b6c0718728b9eaf81121acd96b6a36b
6
+ metadata.gz: 8d57a97cefac3576c5d806c14786b05a1530920d9f22fd2f7aac5658248ec7acc9f8243c80d1b510430ab671b2c58f6a42dfef898c64a1f8b23bbc4510c5ae08
7
+ data.tar.gz: 2f33bf32d46348912f49d278dfce4d9d5a125f9730ffb70b1d6b014662e5bed67915e72db97cbb1f26d825cf513a9a9cd994e1019d9a27e6a9fdbec275ace76a
@@ -12,7 +12,7 @@ module ActsAsLocalized
12
12
  def acts_as_localized *attributes
13
13
  attributes.each do |attribute|
14
14
  define_method attribute do
15
- read_attribute("#{attribute}_#{I18n.locale}")
15
+ send("#{attribute}_#{I18n.locale}")
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsLocalized
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -58,6 +58,13 @@ class ActsAsLocalizedTest < MiniTest::Test
58
58
  assert_equal 'content EN', model.attr
59
59
  I18n.locale = :fr
60
60
  assert_equal 'content FR', model.attr
61
+
62
+ begin
63
+ I18n.locale = :invalid
64
+ model.attr
65
+ rescue => e
66
+ assert e.is_a?(NoMethodError)
67
+ end
61
68
  end
62
69
 
63
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_localized
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Khabarov