require 'active_support/concern'
module M
extend ActiveSupport::Concern
included do
scope :disabled, where(:disabled => true)
end
module ClassMethods
...
endend
On Sunday, December 2, 2012 7:06:31 PM UTC-6, Frederick Cheung wrote:
with how as::concern changes the behaviour of include so as to setup
module dependencies.
Fred
https://github.com/twinge/questionnaire_engine/tree/8836c2a3b92e676ea...
https://github.com/twinge/questionnaire_engine/blob/8836c2a3b92e676ea...
https://github.com/twinge/questionnaire_engine/blob/8836c2a3b92e676ea...
wrote:
`block (2
passes.
the
ruby
--On Dec 2, 9:00 pm, Frederick Cheung wrote:
weird thing to do
- it's supposed to be used on modules. What were you trying to do
with it?
And I assume that the reason this causes a problem is something to doOn Dec 2, 7:22 pm, Weston Platter wrote:
What you said makes sense.
I incorrectly said I commented out
include MyEngine::SomeController
when I meant to say commenting out
extend ActiveSupport::Concern
Calling extend activesupport::concern on a controller sounds like aWhat you said makes sense.
I incorrectly said I commented out
include MyEngine::SomeController
when I meant to say commenting out
extend ActiveSupport::Concern
weird thing to do
- it's supposed to be used on modules. What were you trying to do
with it?
with how as::concern changes the behaviour of include so as to setup
module dependencies.
Fred
fixes the issue.
The codeabse is here,
The codeabse is here,
.
The specific Controller Class is here,
The specific Controller Class is here,
The specific Controller Spec test is here,
On Saturday, December 1, 2012 7:11:02 PM UTC-6, Frederick Cheung
On Dec 1, 7:19 pm, Weston Platter wrote:
But, this breaks my rpsec controller tests because of an undefined
"recycle" method.
But, this breaks my rpsec controller tests because of an undefined
"recycle" method.
12) Qe::Admin::QuestionPagesController POST reorder
Failure/Error: xhr :post, :create,
NoMethodError:
undefined method `recycle!' for
#<Qe::Admin::QuestionPagesController:0x007f80aa1c7528>
# ./spec/controllers/admin/pages_controller_spec.rb:69:in
Failure/Error: xhr :post, :create,
NoMethodError:
undefined method `recycle!' for
#<Qe::Admin::QuestionPagesController:0x007f80aa1c7528>
# ./spec/controllers/admin/pages_controller_spec.rb:69:in
levels) in <top (required)>'
When I comment out the "include MyEngine::Controller" everything
If it's commenting out the include that fixes things, why are you so
sure that it's the extend at fault rather than something else in the
module? Personally I'd be inclined to thing that by including your
module you're accidentally shadowing an existing method on the
controller - if you were to show a minimal example that reproduces
sure that it's the extend at fault rather than something else in the
module? Personally I'd be inclined to thing that by including your
module you're accidentally shadowing an existing method on the
controller - if you were to show a minimal example that reproduces
problem rather than dummy code someone might be able to have a guess
(I suspect the issue may have been lost in translation from your
actual code to the example you gave since the latter isn't valid
(I suspect the issue may have been lost in translation from your
actual code to the example you gave since the latter isn't valid
(for example you're including a class rather than a module)
Fred
Why?
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/xZq-sWuJtloJ.
For more options, visit https://groups.google.com/groups/opt_out.