Comments (5)
@jonleighton and @tenderlove, could you please check? ❤️
from rails.
@rubymaverick: How does this code behave on 3-0-stable? (Assuming you define the default scope using the class-level macro, of course.) Thanks.
from rails.
@jonleighton in 3-0 stable the default scope is ignored, so the query above just becomes:
SELECT COUNT(*) FROM "users"
Also, FYI, if you do SELECT COUNT(*) FROM "users" ORDER BY created_at DESC in postgresql it will raise an error (sqlite just ignores it)
from rails.
Okay, I will fix. We shouldn't just discard the default scope entirely though - if you have default_scope where(:published => true)
or something then you would expect that to affect the count query.
from rails.
Won't just delegating aggregation queries to :unscoped
solve the problem?
from rails.
Related Issues (20)
- `ActiveRecord::ConnectionAdapters::SQLite3Adapter#initialize` does not correctly create missing parent directories HOT 6
- `Object.as_json` is too optimistic and causes errors in 3rd party code. HOT 4
- `ActiveSupport::Inflector` isolation/conflicts: recommended approach HOT 4
- ActiveRecord/Postgresql composite primary keys breaks count query on includes+references HOT 5
- Individually uncommenting `ActiveRecord` related framework defaults, not enabling respective behaviour HOT 3
- Remove trailing slash from void HTML elements HOT 2
- It is not possible to pass raw JSON string to ActiveRecord JSON type attribute HOT 1
- undefined method `path' for class Selenium::WebDriver::DriverFinder (NoMethodError) with selenium-webdriver 4.20.0 HOT 4
- Need a Rails Guide on Dynamic Forms with Hotwire HOT 1
- Truncate tables before test runs is hanging on Linux
- Inconsistent documentation between ActiveRecord::RecordNotSaved and ActiveRecord::Persistence::ClassMethods#save!
- Prevent fork bombs in ActiveSupport::ForkTracker HOT 1
- Avoid Seed Data Execution in CI by Replacing `db:setup` with `db:test:prepare` HOT 3
- ActiveRecord time field issue with timezone HOT 4
- `test_render_mutate_string_literal` shows `inline template:1: warning: literal string will be frozen in the future` HOT 2
- ActionMailer deliver_later doesn't work in development (delivery_method = :file) HOT 2
- Form tokens are ignored when `csrf_meta_tags` is present HOT 5
- undefined method `accessor' for #<ActiveModel::Type::Value:0x0000563c30ebdd50> HOT 6
- Support built-in compressor for `ActiveSupport::Cache` HOT 2
- Scaffolding with namespace generates broken partial view links with tailwind HOT 2
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 rails.