josevalim-inherited_resources 0.4.6 → 0.5.0
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/README +1 -1
- data/lib/inherited_resources/base_helpers.rb +1 -14
- data/lib/inherited_resources/class_methods.rb +3 -1
- metadata +1 -1
data/README
CHANGED
@@ -200,20 +200,7 @@ module InheritedResources #:nodoc:
|
|
200
200
|
options[:default] = defaults.push(options[:default])
|
201
201
|
options[:default].flatten!
|
202
202
|
|
203
|
-
|
204
|
-
#
|
205
|
-
# message = I18n.t options[:default].shift, options
|
206
|
-
#
|
207
|
-
first = options[:default].shift
|
208
|
-
begin
|
209
|
-
message = I18n.t first, options
|
210
|
-
rescue Exception => e
|
211
|
-
options[:resource] = options[:resource_name]
|
212
|
-
warn "[DEPRECATION] {{resource}} is deprecated as interpolation option " <<
|
213
|
-
"in InheritedResources I18n. Please use {{resource_name}} instead."
|
214
|
-
message = I18n.t first, options
|
215
|
-
end
|
216
|
-
|
203
|
+
message = I18n.t options[:default].shift, options
|
217
204
|
flash[status] = message unless message.blank?
|
218
205
|
end
|
219
206
|
|
@@ -369,6 +369,8 @@ module InheritedResources #:nodoc:
|
|
369
369
|
def initialize_resources_class_accessors!(base)
|
370
370
|
# Add and protect class accessors
|
371
371
|
base.class_eval do
|
372
|
+
metaklass = (class << self; self; end)
|
373
|
+
|
372
374
|
RESOURCES_CLASS_ACCESSORS.each do |cattr|
|
373
375
|
cattr_accessor "#{cattr}", :instance_writer => false
|
374
376
|
|
@@ -376,7 +378,7 @@ module InheritedResources #:nodoc:
|
|
376
378
|
self.send :protected, cattr
|
377
379
|
|
378
380
|
# Protect class writer
|
379
|
-
|
381
|
+
metaklass.send :protected, "#{cattr}="
|
380
382
|
end
|
381
383
|
end
|
382
384
|
|