pop
pop copied to clipboard
support inverse_of with has_many and conditional has many
hi
class Author
has_many :books, inverse_of: 'author'
has_many :history_books, inverse_of: 'author', -> { where(category: "history").order("created_at desc") }
end
class Book
belongs_to :author
end
maybe
type Author struct {
HistoryBooks Book `json:"history_books" inverse_of:"author" where:"category='history'" orderBy:"created_at desc"`
}
Seems like it's complicated and no user case currently.