Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

And now we can fix Rails 3.2 deprecation warning for ActiveSupport::C…

…oncern.

From now InstanceMethods are not included automatically.
  • Loading branch information...
commit e54c36565c66aa08209fb194c855ba80fa050eb1 1 parent 4183a2a
@Imomoi Imomoi authored committed
Showing with 24 additions and 26 deletions.
  1. +24 −26 lib/cell/deprecations.rb
View
50 lib/cell/deprecations.rb
@@ -3,41 +3,39 @@ module Cell
# Note that Deprecations are only available for Cell::Rails.
module Deprecations
extend ActiveSupport::Concern
-
+
included do
attr_reader :options
end
-
-
+
+
module ClassMethods
def build_for(controller, *args)
build_class_for(controller, *args).
new(controller, *args)
end
end
-
-
- module InstanceMethods
- def initialize(parent_controller, *args)
- super(parent_controller) # the real Rails.new.
- setup_backwardibility(*args)
- end
-
- # Some people still like #options and assume it's a hash.
- def setup_backwardibility(*args)
- @_options = (args.first.is_a?(Hash) and args.size == 1) ? args.first : args
- @options = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(@_options, "#options is deprecated and was removed in Cells 3.7. Please use state-args.")
- end
-
- def render_state(state, *args)
- return super(state, *args) if state_accepts_args?(state)
- super(state) # backward-compat.
- end
-
- def state_accepts_args?(state)
- method(state).arity != 0
- end
+
+
+ def initialize(parent_controller, *args)
+ super(parent_controller) # the real Rails.new.
+ setup_backwardibility(*args)
+ end
+
+ # Some people still like #options and assume it's a hash.
+ def setup_backwardibility(*args)
+ @_options = (args.first.is_a?(Hash) and args.size == 1) ? args.first : args
+ @options = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(@_options, "#options is deprecated and was removed in Cells 3.7. Please use state-args.")
+ end
+
+ def render_state(state, *args)
+ return super(state, *args) if state_accepts_args?(state)
+ super(state) # backward-compat.
+ end
+
+ def state_accepts_args?(state)
+ method(state).arity != 0
end
-
+
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.