8000 Fix `belongs_to` specification · activeadmin/activeadmin@6aba10f · GitHub
[go: up one dir, main page]

Skip to content

Commit 6aba10f

Browse files
Fix belongs_to specification
I needed to change to association name to make filtering by post in the user's index page, otherwise, the applied filter cannot be properly displayed. But then I need to make sure routes and parameters still use "user".
1 parent 392115d commit 6aba10f

File tree

1 file changed

+1
-1
lines changed
  • spec/support/templates_with_data/admin

1 file changed

+1
-1
lines changed

spec/support/templates_with_data/admin/posts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ActiveAdmin.register Post do
22
permit_params :custom_category_id, :author_id, :title, :body, :published_date, :position, :starred, taggings_attributes: [ :id, :tag_id, :name, :position, :_destroy ]
33

4-
belongs_to :user
4+
belongs_to :author, class_name: "User", param: "user_id", route_name: "user"
55

66
includes :author, :category, :taggings
77

0 commit comments

Comments
 (0)
0