nulogy-gettext_i18n_rails 0.5.0.2 → 0.5.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,10 +15,11 @@ module GettextI18nRails::ActiveRecord
15
15
  end
16
16
 
17
17
  def gettext_translation_for_attribute_name(attribute)
18
- if attribute.to_s.ends_with?('_id')
18
+ attribute = attribute.to_s
19
+ if attribute.ends_with?('_id')
19
20
  humanize_class_name(attribute)
20
21
  else
21
- "#{self}|#{attribute.to_s.split('.').map! {|a| a.humanize }.join('|')}"
22
+ "#{self}|#{attribute.split('.').map! {|a| a.humanize }.join('|')}"
22
23
  end
23
24
  end
24
25
  end
@@ -14,9 +14,6 @@ if defined?(Rails::Railtie)
14
14
  if app.config.gettext_i18n_rails.use_for_active_record_attributes
15
15
  ActiveSupport.on_load :active_record do
16
16
  extend GettextI18nRails::ActiveRecord
17
- end
18
-
19
- ActiveSupport.on_load :active_model do
20
17
  require 'gettext_i18n_rails/active_model.rb'
21
18
  end
22
19
  end
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '0.5.0.2'
2
+ Version = VERSION = '0.5.0.3'
3
3
  end
@@ -27,7 +27,7 @@ describe ActiveRecord::Base do
27
27
 
28
28
  describe :gettext_translation_for_attribute_name do
29
29
  it "translates foreign keys to model name keys" do
30
- Part.gettext_translation_for_attribute_name('car_seat_id').should == 'Car seat'
30
+ Part.gettext_translation_for_attribute_name(:car_seat_id).should == 'Car seat'
31
31
  end
32
32
  end
33
33
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nulogy-gettext_i18n_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.2
4
+ version: 0.5.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: