i18n_rails_helpers 0.15.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module I18nRailsHelpers
2
- VERSION = "0.15.1"
2
+ VERSION = "0.16.0"
3
3
  end
@@ -21,11 +21,11 @@ module I18nRailsHelpers
21
21
  #
22
22
  def t_attr(attribute, model = nil)
23
23
  if model.is_a? Class
24
- model_name = model.name.underscore
24
+ model_class = model
25
25
  elsif model.nil?
26
- model_name = controller_name.singularize
26
+ model_class = controller_name.classify.constantize
27
27
  end
28
- I18n::translate(attribute, :scope => [:activerecord, :attributes, model_name])
28
+ model_class.human_attribute_name(attribute)
29
29
  end
30
30
 
31
31
  # Returns translated name for the given +model+.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_rails_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 33
4
+ hash: 95
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 15
9
- - 1
10
- version: 0.15.1
8
+ - 16
9
+ - 0
10
+ version: 0.16.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-03 00:00:00 +01:00
18
+ date: 2011-11-04 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21