activemodel 3.1.0.rc2 → 3.1.0.rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ module ActiveModel
21
21
  @partial_path = "#{@collection}/#{@element}".freeze
22
22
  @param_key = (namespace ? _singularize(@unnamespaced) : @singular).freeze
23
23
  @route_key = (namespace ? ActiveSupport::Inflector.pluralize(@param_key) : @plural).freeze
24
- @i18n_key = self.underscore.to_sym
24
+ @i18n_key = self.underscore.tr('/', '.').to_sym
25
25
  end
26
26
 
27
27
  # Transform the model name into a more humane format, using I18n. By default,
@@ -35,8 +35,9 @@ module ActiveModel
35
35
  @klass.respond_to?(:i18n_scope)
36
36
 
37
37
  defaults = @klass.lookup_ancestors.map do |klass|
38
- klass.model_name.i18n_key
39
- end
38
+ [klass.model_name.i18n_key,
39
+ klass.model_name.i18n_key.to_s.tr('.', '/').to_sym]
40
+ end.flatten
40
41
 
41
42
  defaults << options[:default] if options[:default]
42
43
  defaults << @human
@@ -44,8 +44,9 @@ module ActiveModel
44
44
  # Specify +options+ with additional translating options.
45
45
  def human_attribute_name(attribute, options = {})
46
46
  defaults = lookup_ancestors.map do |klass|
47
- :"#{self.i18n_scope}.attributes.#{klass.model_name.i18n_key}.#{attribute}"
48
- end
47
+ [:"#{self.i18n_scope}.attributes.#{klass.model_name.i18n_key}.#{attribute}",
48
+ :"#{self.i18n_scope}.attributes.#{klass.model_name.i18n_key.to_s.tr('.', '/')}.#{attribute}"]
49
+ end.flatten
49
50
 
50
51
  defaults << :"attributes.#{attribute}"
51
52
  defaults << options.delete(:default) if options[:default]
@@ -3,7 +3,7 @@ module ActiveModel
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
5
  TINY = 0
6
- PRE = "rc2"
6
+ PRE = "rc3"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424097
4
+ hash: 15424099
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
9
  - 0
10
10
  - rc
11
- - 2
12
- version: 3.1.0.rc2
11
+ - 3
12
+ version: 3.1.0.rc3
13
13
  platform: ruby
14
14
  authors:
15
15
  - David Heinemeier Hansson
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-06-07 00:00:00 Z
20
+ date: 2011-06-08 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: activesupport
@@ -27,14 +27,14 @@ dependencies:
27
27
  requirements:
28
28
  - - "="
29
29
  - !ruby/object:Gem::Version
30
- hash: 15424097
30
+ hash: 15424099
31
31
  segments:
32
32
  - 3
33
33
  - 1
34
34
  - 0
35
35
  - rc
36
- - 2
37
- version: 3.1.0.rc2
36
+ - 3
37
+ version: 3.1.0.rc3
38
38
  type: :runtime
39
39
  version_requirements: *id001
40
40
  - !ruby/object:Gem::Dependency