active_record_union icon indicating copy to clipboard operation
active_record_union copied to clipboard

UNIONs in ActiveRecord! Adds proper union and union_all methods to ActiveRecord::Relation.

Results 15 active_record_union issues
Sort by recently updated
recently updated
newest added

By default, SQL Server table names are of the form 'dbo.table_name.' When this gem attempts to alias the unionized result-set, it tries to use the original table name, which SQL...

Hi! There's a very subtle issue I stumbled upon today if a `union`-ed scope is passed into `ActiveRecord::Relation#merge`. Any criteria from a `union`-built scope gets ignored when the relation gets...

I have a model with a column named `desc`. It works fine when using `pluck` ```rb Mission.where(id: 1).union(id: 2).pluck('desc') # SELECT "missions"."desc" FROM ( (SELECT "missions".* FROM "missions" WHERE "missions"."id"...

Now **Rails 6.0** is released, and it would be cool if there was - a `Gemfile` for Rails 6 - a Travis configuration to run that - probably turn the...

Does this work for a case when I have to do union of multiple columns on 2 tables that does not have any relationship? I don't want all columns. I...

We have added support for `intersect` and `except` locally, was curious if you'd welcome a PR for that, since it expands the scope of the gem beyond union

I had expected that the following code: ```ruby BsRequest.where(id: BsRequestAction.where(id: [1,2]).select(:bs_request_id).union(Review.where(id: [1,2,3]).select(:bs_request_id))) ``` to produce the following query: ```sql SELECT `bs_requests`.* FROM `bs_requests` WHERE `bs_requests`.`id` IN ((SELECT `bs_request_actions`.`bs_request_id` FROM `bs_request_actions`...

Example: Model User: User.none.union(User.none).update_all(username: 'new username') Setting username = 'new username' to all users of the database -> When User.none.union(User.none).count is equal to 0! Rails version: Rails 5.0.5 Ruby version:...