Comments (3)
You can also just use .to_union_sql
ex:
Model.with.recursive(folders: Model.union_all(base, recursive).to_union_sql) ....
That'll just spit out a more proper union, grouping query without nesting it within a from
clause.
from activerecordextended.
@GeorgeKaraszi Thanks! I was sure I was missing something, so that helps a lot!
from activerecordextended.
Would it be worth adding a note about this to the README in the WITH RECURSIVE section?
from activerecordextended.
Related Issues (20)
- Error when trying to query a JSONB field that is an array of objects
- undefined method `with` for Model HOT 3
- Double query execution for relation HOT 1
- use this with simple_form_for HOT 1
- need support for rails 6.1 HOT 2
- Undefined method with for Model HOT 22
- Arel::Nodes::Contains Warnings with Rails 6.1 HOT 5
- Undefined method 'union' on test environment HOT 2
- Question: Can't Figure Out Manager Tree HOT 6
- Rails 6.1.1 throws warning - already initialized constant Arel::Nodes::Contains
- SELECT FROM THE CTE table name HOT 1
- `ar_outer_joins` dependency? HOT 2
- How to query for records that don't include a specific value in an array? HOT 1
- Merging union queries leads to conditionless queries HOT 3
- contains visitor breaks rails native Arel::Nodes::Contains for irregular table names HOT 3
- CTE with values does not work
- Weird behavior with column name "notifications" HOT 4
- Need the ability to specify `MATERIALIZED`/`NOT MATERIALIZED` on CTE HOT 1
- SystemStackError (Infinite Loop) when using .with HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activerecordextended.