Comments (2)
Not sure if it is related but,
somehow I cannot execute my query by doing
ActiveRecord::Base.connection.execute(method_generating_arel_object_request)
when in my projection I have .average.as("somename") because the following error is raised
TypeError: no implicit conversion of Arel::SelectManager into String
from /Users/{users}/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:97:in `async_exec'
so I ended up doing
ActiveRecord::Base.connection.execute(method_generating_arel_object_request.to_sql)
from arel.
This doesn't sound a like a problem with ARel, but a problem with the database adapter or possibly your column types. The database adapter uses the column type to cast it to a Ruby object. It could be that the column type is wrong, or that the database adapter doesn't know how to handle that type. Take a look at the pg_typeof
function. You can use that function to figure out what type you're selecting. From there, either fix your data so it's the right type, or file a bug on the Rails side (as it's a bug in the adapter).
Thanks!
from arel.
Related Issues (20)
- Support of batched UPSERT and UPDATE queries HOT 2
- Migration from 6 to 7 HOT 1
- UncaughtThrowError: uncaught throw {:__recursive_key__=>true, 19667120=>true} from visitors/reduce.rb:13 HOT 4
- Arel::Nodes::Division does not divide first argument by second argument HOT 2
- Arel node for an array element (suffix operator) HOT 2
- Delegate #to_s to #to_sql HOT 1
- multiple arel conditions raise SystemStackError: stack level too deep HOT 1
- Limit expression generated with bind param but no value (works with 6.0.4/breaks with 7.1.4) HOT 4
- activerecord (5.1.4) lib/active_record/relation/predicate_builder.rb:113:in `new' not passing a value, causing Arel 9.0.0 to fail HOT 1
- SqlLiteral does not serialize/de-serailize correctly HOT 1
- `NameError: uninitialized constant FakeRecord::Connection::DateTime` with Ruby 2.5.0 HOT 2
- Atomic upsert? HOT 2
- Registering Visitors HOT 1
- Expression in `in` is broken in 7.1.4 and 8.0.0 HOT 6
- union operation broken in 9.0.0 HOT 1
- Why is `Arel::Nodes::Or.neq` different from `Arel::Nodes::And.new`? HOT 2
- Timestamp between columns, how can i do it? HOT 1
- NamedFunction as HOT 2
- Documentation 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 arel.