You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module FollowableModelConcern extend ActiveSupport::Concern
included do
has_many :followers, -> { order :created_at }, class_name: 'User', through: :followings
has_many :followings, as: :followable, dependent: :destroy
end
end
It is included in several of my models. How can I exclude :followings field for example from edit action? I don't want to repeat exclude code for every model
The text was updated successfully, but these errors were encountered:
Seems like I should use rails admin config inside included:
included do
has_many :followers, -> { order :created_at }, class_name: 'User', through: :followings
has_many :followings, as: :followable, dependent: :destroy
rails_admin do
edit do
exclude_fields :followings
end
end
end
but when I include 2 concerns into my model, only one is applied. Probably it's because exclude_fields method rewrites exclude fields array...
I have concern like
It is included in several of my models. How can I exclude :followings field for example from edit action? I don't want to repeat exclude code for every model
The text was updated successfully, but these errors were encountered: