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
class UserBrand < ActiveRecord::Base
acts_as_paranoid
belongs_to :user
belongs_to :brand
end
Everything works fine in the application (that is the relation works), but administrate complains when I add the following to BrandDashboard.ATTRIBUTE_TYPES
I also worked around it by modifying the view to special case the handling of the 'followers' attribute, but that seems like a hack.
I'm using administrate 0.2.0 with rails 4.2.
Thanks.
The text was updated successfully, but these errors were encountered:
mooreds
changed the title
Unable to display has many relationship if source is used in the relationship
Unable to display has many relationship if "source" is used in the relationship
Oct 28, 2016
Hiya folks,
I have a model that has a has many through relationship, but the name of one of the sides is custom.
User model:
Brands model:
UserBrand model:
Everything works fine in the application (that is the relation works), but administrate complains when I add the following to
BrandDashboard.ATTRIBUTE_TYPES
I see this error message:
I think this is because the dashboard has no way of knowing that followers are actually a user, and so the user dashboard should actually be used.
Is there a way to point that out?
I searched with google and through the issues of this project, but didn't see anything that seemed to help. In particular, it was't clear to me if it was possible to customize the hasmany code https://github.com/thoughtbot/administrate/blob/v0.2.0/lib/administrate/field/has_many.rb to display a different dashboard. Should I just subclass the hasmany class?
I also worked around it by modifying the view to special case the handling of the 'followers' attribute, but that seems like a hack.
I'm using administrate 0.2.0 with rails 4.2.
Thanks.
The text was updated successfully, but these errors were encountered: