josevalim-inherited_resources 0.4.6 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,6 +1,6 @@
1
1
  Inherited Resources
2
2
  License: MIT
3
- Version: 0.4.6
3
+ Version: 0.5.0
4
4
 
5
5
  You can also read this README in pretty html at the GitHub project Wiki page:
6
6
 
@@ -200,20 +200,7 @@ module InheritedResources #:nodoc:
200
200
  options[:default] = defaults.push(options[:default])
201
201
  options[:default].flatten!
202
202
 
203
- # TODO Deprecate this whole begin/rescue block and replace it for:
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
- metaclass.send :protected, "#{cattr}="
381
+ metaklass.send :protected, "#{cattr}="
380
382
  end
381
383
  end
382
384
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: josevalim-inherited_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jos\xC3\xA9 Valim"