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 error on edge rails #556
Comments
Can you please give us more information like what steps you followed to get to this point? |
@parndt well, sure, one second, but comment about |
For associated model: module MagazCore
class Page < ActiveRecord::Base
self.table_name = 'pages'
extend FriendlyId
belongs_to :shop
friendly_id :handle, use: [:slugged, :scoped], scope: :shop
validates :title,
presence: true,
uniqueness: { scope: :shop_id }
def should_generate_new_friendly_id?
handle_changed?
end
end
end I invoke |
I'm guessing it was a method that was around on non-edge Rails? It was introduced in fda8d3c |
@parndt I've seen that commit, but I don't see |
@andriytyurnikov strange. |
Hmm, perhaps they removed that method in edge? I don't have an edge Rails env setup at the moment, but another way to do it @andriytyurnikov is:
If you can verify that works in your edge Rails env, perhaps we should change it to that. All we're trying to do there is find and cache the type of the column that is the primary key. Probably a few ways to do that, one of which was a 'primary' method that was true on the column that was the primary key. |
@jhdavids8 , I'l give it a try, but again, |
@jhdavids8 , I've made monkeypatch with code, that you've offered - my tests green now, thanks! |
Great! Do you want to submit the PR with that fix? |
done ;) |
@andriytyurnikov I double checked this, and it's it's defined using attr_accessor :primary on 4.1 and lower. Will merge your fix for Edge Rails - thanks! |
columns.find(&:primary).type
I can not find method primary in rails docs anyways
The text was updated successfully, but these errors were encountered: