pop icon indicating copy to clipboard operation
pop copied to clipboard

support inverse_of with has_many and conditional has many

Open u007 opened this issue 6 years ago • 1 comments

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"`

}

u007 avatar Apr 13 '18 07:04 u007

Seems like it's complicated and no user case currently.

petar-dambovaliev avatar May 20 '18 17:05 petar-dambovaliev