jmonteiro-mongo_mapper 0.1.5 → 0.1.6
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.
- data/VERSION +1 -1
- data/lib/mongo_mapper/plugins/rails.rb +3 -3
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
@@ -60,19 +60,19 @@ module MongoMapper
|
|
60
60
|
defaults.flatten!
|
61
61
|
defaults << attribute_key_name.to_s.humanize
|
62
62
|
options[:count] ||= 1
|
63
|
-
I18n.translate(defaults.shift, options.merge(:default => defaults, :scope => [:
|
63
|
+
I18n.translate(defaults.shift, options.merge(:default => defaults, :scope => [:mongo_mapper, :attributes]))
|
64
64
|
end
|
65
65
|
|
66
66
|
# Transform the modelname into a more humane format, using I18n.
|
67
67
|
# Defaults to the basic humanize method.
|
68
|
-
# Default scope of the translation is
|
68
|
+
# Default scope of the translation is mongo_mapper.models
|
69
69
|
# Specify +options+ with additional translating options.
|
70
70
|
def human_name(options = {})
|
71
71
|
defaults = self_and_descendants.map do |klass|
|
72
72
|
:"#{klass.name.underscore}"
|
73
73
|
end
|
74
74
|
defaults << self.name.humanize
|
75
|
-
I18n.translate(defaults.shift, {:scope => [:
|
75
|
+
I18n.translate(defaults.shift, {:scope => [:mongo_mapper, :models], :count => 1, :default => defaults}.merge(options))
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|