thetron / mongoid_token

A little random, unique token generator for Mongoid documents.
MIT License
182 stars 91 forks source link

Define Method No Method Error #30

Closed sphw closed 10 years ago

sphw commented 11 years ago

/home/xwsaw/.rvm/gems/ruby-2.0.0-p0/bundler/gems/mongoid_token-4009f4eefd36/lib/mongoid/token/collision_resolver.rb:28:in alias_method_with_collision_resolution': private methoddefine_method' called fo r Video:Class (NoMethodError)

This is the error I am getting when I try to run the rails server.

thetron commented 11 years ago

Hmmm. I haven't tested this (yet) against 2.0.0. Will have a quick look now and see if I can replicate that here.

sphw commented 11 years ago

thanks

thetron commented 11 years ago

Was finally able to get ruby 2.0.0 installed and try this out with one of my own apps - not having any issues though. Are you still having this problem? Are you able to provide some more context? Maybe your gemfile and config/mongoid.yml? And maybe the relevant parts of your model too? Not quite sure where to start with this one.

sphw commented 11 years ago

https://github.com/wisesascha/PixelMob. That is the github repository for it. You will need to rollback to commit 927936be7dd8745be08263d77af0bd6f1424bf8f

thetron commented 11 years ago

@wisesascha I've just pushed a branch up, which I believe should fix this issue. I've tried it against your app and it seems to work fine. You're welcome to test it yourself if you like, with:

gem 'mongoid_token', :git => 'git://github.com/thetron/mongoid_token.git', :branch => 'patch/collisions-define-method'

I'm hoping to push the release in the next few days if I can sort out one other feature.

sphw commented 11 years ago

Hey I just want to say thanks so much for fixing it. It works perfectly now.

thetron commented 11 years ago

Awesome. Glad to hear it.

I'll keep this issue open until 2.0.1, in the meantime you can continue to use that branch.

jeremyhaile commented 11 years ago

This also occurs for me on ruby 1.9.3. Using the branch fixed it, but I couldn't even start rails with the latest 2.0.0

oveddan commented 11 years ago

This occurs to be as well with ruby 1.9.3

noiseunion commented 11 years ago

:+1: - same for me on 1.9.3 - but the patch fixed it!

lanvige commented 11 years ago

Thanks for the patch, it fix the issue for me, Ruby 2.0.0-p125

jgarber commented 11 years ago

:+1: on Ruby 2.0.0

jeremyhaile commented 10 years ago

Why hasn't this been merged yet?

thetron commented 10 years ago

Thanks everyone for your constructive feedback. It's up on rubygems now, and i've also added Ruby 2.0.0 to the Travis config.

:icecream: