my_easy_globalize2_accessors 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.1.0
@@ -7,14 +7,15 @@ module ActiveRecord
7
7
  module ActMethods
8
8
  def globalize_accessors(*attr_names)
9
9
  languages = attr_names
10
- attribs = globalize_options[:translated_attributes]
10
+ attribs = translated_attribute_names
11
11
  attribs.each do |attr_name|
12
12
  languages.each do |with_locale|
13
- define_method :"#{attr_name}_#{with_locale}" do
13
+ safe_locale = with_locale.to_s.gsub("-", "_")
14
+ define_method :"#{attr_name}_#{safe_locale}" do
14
15
  globalize.fetch with_locale, attr_name
15
16
  end
16
17
 
17
- define_method :"#{attr_name}_#{with_locale}=" do |val|
18
+ define_method :"#{attr_name}_#{safe_locale}=" do |val|
18
19
  globalize.stash with_locale, attr_name, val
19
20
  self[attr_name] = val
20
21
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{my_easy_globalize2_accessors}
8
- s.version = "0.0.0"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Carper"]
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
+ - 1
7
8
  - 0
8
- - 0
9
- version: 0.0.0
9
+ version: 0.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dan Carper