Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: undefined local variable or method `root' for ... #78

Closed
GildedHonour opened this issue May 31, 2015 · 3 comments · Fixed by #105
Closed

NameError: undefined local variable or method `root' for ... #78

GildedHonour opened this issue May 31, 2015 · 3 comments · Fixed by #105

Comments

@GildedHonour
Copy link

The version 0.4.10


message = ActsAsMessageable::Message.find(id)

[1] pry(#<MessageBox>)> message
=> #<ActsAsMessageable::Message:0x007f0554c1fd08
 id: 10819,
 topic: "123456",
 body: "fdsfdsfdsfds 3242432",
 received_messageable_id: 7452,
 received_messageable_type: "User",
 sent_messageable_id: 8291,
 sent_messageable_type: "Professor",
 opened: false,
 recipient_delete: false,
 sender_delete: false,
 created_at: Sat, 30 May 2015 17:44:54 UTC +00:00,
 updated_at: Sat, 30 May 2015 17:44:54 UTC +00:00,
 ancestry: nil,
 recipient_permanent_delete: false,
 sender_permanent_delete: false>


[1] pry(#<MessageBox>)> message.conversation
NameError: undefined local variable or method `root' for #<ActsAsMessageable::Message:0x00000004095700>
from /home/alex/.rvm/gems/ruby-2.1.5/gems/activemodel-4.2.0/lib/active_model/attribute_methods.rb:433:in `method_missing'
@LTe LTe added the More info label Apr 19, 2020
@LTe
Copy link
Owner

LTe commented Apr 19, 2020

Can you still reproduce it?

@GildedHonour
Copy link
Author

Yeah, I'm still sitting here as 5 years ago, with the same bug, reproducing it.

@GildedHonour GildedHonour reopened this May 5, 2020
LTe added a commit that referenced this issue May 5, 2020
Message class was initialized with `has_ancestry` method _AFTER_ User
class had been loaded. It caused issues with rails console when someone
loaded only `ActsAsMessageable::Message` class.

Closes #78
@LTe
Copy link
Owner

LTe commented May 5, 2020

back_from_the_future

Thanks @GildedHonour for your patience! Shall we back to the future and fix this bug once and for all? Happy messaging!

@LTe LTe closed this as completed in #105 May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants