Comments (3)
Thank you! Fixed in 7.0.2.
from pagy.
Hi @elliotlarson, I would need a working self contained support to reproduce this with one click and start working on the fix.
I am afraid a verbal description of your code, is not enough, sorry.
Thanks.
from pagy.
Okay, how about this script pagy_error.rb
:
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "sqlite3"
gem "activerecord"
gem "pagy"
gem "debug"
end
require "active_record"
include Pagy::Backend
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.establish_connection(
adapter: "sqlite3",
database: ":memory:", # using in memory data store
)
ActiveRecord::Schema.define do
create_table :manufacturers do |t|
t.string :name
end
create_table :panels do |t|
t.string :name
t.integer :manufacturer_id
end
create_table :projects do |t|
t.string :name
t.integer :panel_id
end
end
class Manufacturer < ActiveRecord::Base
has_many :panels
scope(
:with_counts, lambda do
table = arel_table
panels = Panel.arel_table
active_panels_count = panels
.project(Arel.star.count)
.where(table[:id].eq(panels[:manufacturer_id]))
.as("active_panels_count")
select(
table[Arel.star],
active_panels_count,
)
end
)
end
class Project < ActiveRecord::Base
belongs_to :panel
belongs_to :manufacturer
end
class Panel < ActiveRecord::Base
belongs_to :manufacturer
end
manufacturers = Manufacturer.with_counts
debugger
pagy, manufacturers = pagy(Manufacturer.with_counts)
debugger
You get to the first debugger successfully, but if you continue, SQLite throws an error when the pagy
method is called.
Note: I'm running this with Ruby 3.2.3
from pagy.
Related Issues (20)
- Bug: pagy_search wrong number of arguments HOT 10
- Bug: Alias for an aggregate result is removed HOT 9
- Docs: 7.0 has an undocumented breaking change for active page styling HOT 5
- Docs: Which branch should PRs be made against? HOT 3
- Docs: Update performance metrics HOT 5
- Trim doesn't call with pagy_nav_js when first page is active
- Bug: Adapt with Mongoid add extention HOT 1
- Bug: Pagy::Backend#pagy_get_vars `count_args` gets ignored HOT 3
- Docs: https://ddnexus.github.io/pagy/quick-start/#configure HOT 1
- Bug: Missing initializer in documentation HOT 1
- Bug: wrong number of arguments (given 2, expected 0) HOT 2
- Bug: wrong number of arguments (given 2, expected 0) HOT 1
- Bug: Pagy not working with Geocoder gem
- Bug: Undocumented backwards-incompatible change of empty "page" parameter introduced in 6.4.0 HOT 3
- Docs: lost section about wrap existing pagination with pagy_calendar HOT 1
- Bug: Request for Pagy Gem: Making Commands Platform Independent HOT 1
- Bug: Pagy 8.4.0 is broken with MS SQL server HOT 18
- Bug: Only Limit 1 Query HOT 3
- Documentation: `anchor_string` option in `pagy_bootstrap_nav` (example from documentation) doesn't appear to be working 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 pagy.