-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
hbtm with order brokes edit page #2067
Comments
Also seeing this error on the has and belongs to many association |
Have same problem with:
|
Guys, I found some solution which works: I replaced |
Having the same issue as well. |
has_and_belongs_to_many :users, Proc.new { order last_name: :asc } |
Any updates on this? that did Proc new did not work for me. |
It works for me, thanks @kenjione . |
FWIW I just hit this in 0.8.1, changing the '->' to 'proc' enabled the rails_admin edit page to load. There seems to be no other side-effects, but it's a bit annoying because the official docs all point to lambdas as the way to add a scope to the relation. Is there an alternative to instance_eval that does not pass the receiver as an argument? PS: I also tried adding a param to the lambda which did enable the edit page to function, but I started getting this deprecation warning around my site (I sometimes preload the association):
|
class Group < ActiveRecord::Base
has_and_belongs_to_many :users, -> { order last_name: :asc }
end
group edit page:
ArgumentError - wrong number of arguments (1 for 0):
rails_admin (0.6.3) lib/rails_admin/adapters/active_record/association.rb:61:in `read_only?'
The text was updated successfully, but these errors were encountered: