Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flipper-active_record breaks in 0.26.2+ with Rails 4.2 #858

Open
clinejj opened this issue Mar 6, 2024 · 2 comments
Open

Flipper-active_record breaks in 0.26.2+ with Rails 4.2 #858

clinejj opened this issue Mar 6, 2024 · 2 comments

Comments

@clinejj
Copy link
Contributor

clinejj commented Mar 6, 2024

We use Rails 4.2, and after updating from Flipper 0.26.1 to 0.26.2 saw the below error after loading the web UI. The only change was #707, which my guess is the culprit is going from @feature_class.connection.select_all to @feature_class.connection.select_rows.

The flipper-active_record gem has a minimum Rails 4.2 dependency, so would ideally have this patched or a minimum AR version specified.

Stack trace:

TypeError at /admin/flipper
no implicit conversion of Arel::SelectManager into String

ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#translate_exception_class
activerecord (4.2.11.3) lib/active_record/connection_adapters/abstract_adapter.rb, line 473
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#log
activerecord (4.2.11.3) lib/active_record/connection_adapters/abstract_adapter.rb, line 486
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#log
activerecord (4.2.11.3) lib/active_record/connection_adapters/abstract_adapter.rb, line 477
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#exec_no_cache
activerecord (4.2.11.3) lib/active_record/connection_adapters/postgresql_adapter.rb, line 592
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#execute_and_clear
activerecord (4.2.11.3) lib/active_record/connection_adapters/postgresql_adapter.rb, line 584
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#select_rows
activerecord (4.2.11.3) lib/active_record/connection_adapters/postgresql/database_statements.rb, line 70
block in Flipper::Adapters::ActiveRecord#get_all
flipper-active_record (0.26.2) lib/flipper/adapters/active_record.rb, line 127
ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection
activerecord (4.2.11.3) lib/active_record/connection_adapters/abstract/connection_pool.rb, line 292
Flipper::Adapters::ActiveRecord#with_connection
flipper-active_record (0.26.2) lib/flipper/adapters/active_record.rb, line 259
Flipper::Adapters::ActiveRecord#get_all
flipper-active_record (0.26.2) lib/flipper/adapters/active_record.rb, line 120
Flipper::Adapters::Memoizable#get_all
flipper (0.26.2) lib/flipper/adapters/memoizable.rb, line 104
Flipper::DSL#preload_all
flipper (0.26.2) lib/flipper/dsl.rb, line 202
@jnunemaker
Copy link
Collaborator

Open to a PR but not sure I could even get 4.2 running again in an ok amount of time. I lowered the dependency version for people in the past who wanted to operate with YMMV on older versions. We try to doc everywhere that we do not support the older versions officially. Maybe I should put a note by the gemspec dep too...

@jnunemaker
Copy link
Collaborator

Probably the "fix" is to use select_all for 4.2 else select_rows.

astupka added a commit to customink/flipper_rails_upgrades that referenced this issue Apr 25, 2024
astupka added a commit to customink/flipper_rails_upgrades that referenced this issue Apr 25, 2024
astupka added a commit to customink/flipper_rails_upgrades that referenced this issue Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants