-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
belongs_to with :primary_key raises exception on rendering _form #777
Comments
Ah, you're right! Looks like it should be pulling in the |
@nickcharlton i'll investigate it further anytime soon |
Resolves #777. Changes: - Allow permitted_attribute to receive options, which can include primary_key. Use primary_key if specified, otherwise use `id`. - Change `orders` primary key to `code` and `payments` foreign key to `order_code`. - Remove `created_at` and `updated_at` from `Payment`'s `ATTRIBUTE_TYPES` because the `payments` table doesn't actually have those columns. - Add `edit` route for `payments`.
Resolves #777. Changes: - Allow permitted_attribute to receive options, which can include primary_key. Use primary_key if specified, otherwise use `id`. - Change `orders` primary key to `code` and `payments` foreign key to `order_code`. - Remove `created_at` and `updated_at` from `Payment`'s `ATTRIBUTE_TYPES` because the `payments` table doesn't actually have those columns. - Add `edit` route for `payments`.
Resolves #777. Changes: - Allow permitted_attribute to receive options, which can include primary_key. Use primary_key if specified, otherwise use `id`. - Change `orders` primary key to `code` and `payments` foreign key to `order_code`. - Remove `created_at` and `updated_at` from `Payment`'s `ATTRIBUTE_TYPES` because the `payments` table doesn't actually have those columns. - Add `edit` route for `payments`.
@nickcharlton Hello, Nick, if you'll have some time could you check my PR above please? It's pretty simple. I decided to implement |
Resolves #777. Changes: - Allow permitted_attribute to receive options, which can include primary_key. Use primary_key if specified, otherwise use `id`. - Change `orders` primary key to `code` and `payments` foreign key to `order_code`. - Remove `created_at` and `updated_at` from `Payment`'s `ATTRIBUTE_TYPES` because the `payments` table doesn't actually have those columns. - Add `edit` route for `payments`.
Administrate 0.4 and Rails 5.02.
setup:
and in UserDashboard we have
The cause of problem is hardcoded id at: https://github.com/thoughtbot/administrate/blob/master/lib/administrate/field/belongs_to.rb#L7
I didn't find a quick workaround, but i think it must be something like this
:"#{attr}_#{primary_key}"
or I'm missing something.
The text was updated successfully, but these errors were encountered: