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

Draper integration weirdness #319

Closed
steveklabnik opened this issue Aug 28, 2012 · 10 comments
Closed

Draper integration weirdness #319

steveklabnik opened this issue Aug 28, 2012 · 10 comments

Comments

@steveklabnik
Copy link

Hi there!

I'm the current maintainer of draper, and @resgraph reported a bug recently: jcasimir/draper#260

It appears that since you do something special with finder methods, and we're proxying AR, that there's a conflict. I'm not super sure how FriendlyId works, since I don't use it personally, but Draper's codebase is much smaller. I think it has to do with the way that we delegate id, which is here: https://github.com/jcasimir/draper/blob/master/lib/draper/active_model_support.rb

Any thoughts would be appreciated. I'm sure we can figure something out.

@parndt
Copy link
Collaborator

parndt commented Aug 28, 2012

Hey Steve!

That's super weird that it's looking for a slug of 11; usually with friendly_id I would expect that to be a string e.g. 'robert-schmidt'

I don't currently have an answer for this.. any chance of an example application from the OP? Should we post over at jcasimir/draper#260 to work this out?

Cheers

@steveklabnik
Copy link
Author

Either would be fine, if you think it's a bug in Draper and not in FriendlyId, then yeah, let's just chat over there. I bet that's the case.

@norman
Copy link
Owner

norman commented Aug 28, 2012

A very, very superficial look makes me suspect you're not overriding the method in the correct place. In a conceptually similar library I found it convenient to do this:

ActiveRecord::Base.method(:lock).owner.send :remove_method, :lock

before defining the new method.

...although you could fairly say that I ended up having to do that because I didn't work hard enough to find the right place to override the method. Anyway, I'm more than happy to help resolve it on the FriendlyId side if need be, though right now I'm in a bit of a crunch with another project and won't be free for a few days.

@reinh
Copy link

reinh commented Aug 28, 2012

@parndt
Copy link
Collaborator

parndt commented Aug 28, 2012

@reinh true to your word.. (and it could still be our bug!)

@reinh
Copy link

reinh commented Aug 28, 2012

It's just not the same without the memes and trolling.

@amerine
Copy link
Contributor

amerine commented Aug 28, 2012

Or one of these:

👍

@brightball
Copy link

Did anybody ever get a fix for this? We started seeing this issue after upgrading from Rails 3.2.8 to 3.2.11 for the security fix (without any updates to draper or friendly id).

@steveklabnik
Copy link
Author

@aramisbear the ticket in draper is here: drapergem/draper#260

@parndt
Copy link
Collaborator

parndt commented Jan 15, 2013

@aramisbear please ensure you are using FriendlyId 4.0.9 after upgrading to Rails 3.2.11

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

6 participants