-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Labels
clarify apiRename/remove/add something to make the API easier to understandRename/remove/add something to make the API easier to understand
Description
Doing anything other than an inner join is verbose:
UserQuery.new.left_join_tasks.where_tasks(TaskQuery.new.title("Clean up notes"), auto_inner_join: false)Ideally, calling #left_join_task should automatically disable auto inner join. The problem, though, is that nothing stops anyone from calling #where_tasks before calling #left_join_tasks:
UserQuery.new.where_tasks(TaskQuery.new.title("Clean up notes")).left_join_tasksLooking at Avram::BaseQueryTemplate, we could add overload to the #*_join_* methods that accept the assoc_query. This way we can have queries like this:
UserQuery.new.left_join_tasks(TaskQuery.new.title("Clean up notes"))If we insist on having where_tasks in there (probably because it reads nice?), we can make that the argument name:
UserQuery.new.left_join_tasks(where_tasks: TaskQuery.new.title("Clean up notes"))What do you think?
Metadata
Metadata
Assignees
Labels
clarify apiRename/remove/add something to make the API easier to understandRename/remove/add something to make the API easier to understand