ajax-datatables-rails icon indicating copy to clipboard operation
ajax-datatables-rails copied to clipboard

Allow to set a table alias on columns

Open mordaroso opened this issue 3 years ago • 0 comments

I have to work with quite some big tables where we use information from various models. Often joining multiple information from the same table, but through a different association.

For example:

Group to have multiple Users
Group to belong to one User as an admin

And then showing a table like this:

User | Group name | Group admin

Inspired by the addition of Rails 6.1.1 to allow where clause reference association by alias name this PR tries to solve this issue by allowing to overwrite the table_alias of a particular column definition.

This solution should also solve the issue mentioned in https://github.com/jbox-web/ajax-datatables-rails/issues/363

mordaroso avatar Apr 29 '21 14:04 mordaroso