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

Undefined method 'owner=' #13

Closed
m5rk opened this issue Jun 2, 2016 · 9 comments
Closed

Undefined method 'owner=' #13

m5rk opened this issue Jun 2, 2016 · 9 comments

Comments

@m5rk
Copy link

m5rk commented Jun 2, 2016

I'm trying to use the server/service code from this repository in a Rails app. I'm getting this error:

E, [2016-06-02T15:59:47.186642 #753] ERROR -- : undefined method `owner=' for #<SlackRubyBot::Client:0x007f58c27ef500> (NoMethodError)

I looked here for some indication of what owner might be:

https://github.com/dblock/slack-ruby-bot/blob/master/lib/slack-ruby-bot/client.rb

but there's nothing in that gem that appears to help me with owner. I'm not sure what the intent or purpose of setting owner is.

tmsrjs added a commit to tmsrjs/slack-ruby-bot-server that referenced this issue Jun 2, 2016
`config/initializers` makes it look like an app, but the contents
were actually extensions to `bson`, `grape` and `slack-ruby-bot`

This code layout supports granular `require`s where needed.

See also: slack-ruby#13
@tmsrjs
Copy link
Collaborator

tmsrjs commented Jun 2, 2016

Your server will potentially be running many instances of ruby-bot-client so it needs a way to keep track of what client belongs to which team.

I'm guessing you're making granular requires instead of requiring the full gem, that's what's causing the problem. You can either require 'slack-ruby-bot-server' or wait until #14 is merged and a new version is released.

@m5rk
Copy link
Author

m5rk commented Jun 2, 2016

Yeah, I can't use this repository as-is because it's not really pluggable. I'll look into expanding the requires. Thanks!

@dblock
Copy link
Collaborator

dblock commented Jun 2, 2016

I merged #14, @m5rk could you please confirm that that fixed your problem and that gem 'slack-ruby-bot-server', github: 'dblock/slack-ruby-bot-server' in your Gemfile works without further changes? In which case this issue can be closed (we should update CHANGELOG saying this is the problem #14 has fixed too).

@m5rk
Copy link
Author

m5rk commented Jun 2, 2016

@dblock Wow, this team is very responsive. I appreciate that. I think the only remaining obstacle for me is that I don't want to use the Team model defined in this repository, but rather my own.

@m5rk
Copy link
Author

m5rk commented Jun 2, 2016

Similarly, I'd rather not introduce mongoid.

@dblock
Copy link
Collaborator

dblock commented Jun 2, 2016

@m5rk That needs a lot more work IMO, specifically #12. Not something I am going to do in the next few days, but maybe you can take a stab at it?

@dblock
Copy link
Collaborator

dblock commented Jun 2, 2016

Did you run this with #14 though @m5rk? Did it fix the issue? If it did lets close this and maybe @tmsrjs wants to cut a 0.1.1?

@m5rk
Copy link
Author

m5rk commented Jun 2, 2016

I'm currently using this repository's server and service modules via the copy-and-paste method since that allows me to sidestep the mongoid dependencies and the definition of Team. As far as I'm concerned, you've resolved my immediate blocking issue. Thanks!

@dblock
Copy link
Collaborator

dblock commented Jun 2, 2016

Closing this.

@dblock dblock closed this as completed Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants