Closed jasonfb closed 3 years ago
would you be able to include more of the stack trace?
There isn't really a stacktrace, I can simply reproduce this on the Rails console, and it isn't failing inside of the stack, it's just telling me NoMethodError: undefined method `tagged_with' for…
for any User object (which has acts_as_taggable
on it), and like I said, other methods from this gem work (like tag_list
)
The only other debugging thing I think I might be able to provide is to create a simple Spree application that uses the same (open source) gems we use, then add acts_as_taggable
to that to see if the problem comes from some interaction of gems. Of course, if I can reproduce it in a sample (test) app, I can push that up to a GH repo for debugging.
@jasonfb Same problem here. Realized I had a monkeypatch for ActsAsTaggableOn::Taggable::Core
in a rails initializer. That made the original class methods from the Core
module disappear. After moving the patch inside a after_initialize
block, the missing methods would reappear!
We are using acts-as-taggable-on (version 3.5.0 with Rails 4.1)
strangely,
tag_list.add
andtag_list.remove
work fine, but when I calltagged_with
on the same object, I get NoMethodErrormy inelegant work-around, which works but is ugly is:
This is a Spree application, which itself has a bunch of gems interoperating. I mention this in case it is relevant.
Is
tagged_with
implemented via amethod_missing?
.The reason I ask is that I suspect maybe there might be other competing code that has already overloaded method_missing in my app, which is the only explanation I can think of as to why this would be like this
(Incidentally, I find the overuse of method missing to be a really bad pattern, as I often have to deal with conflicting gems trying to overload method_missing)