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

Polyamorous causes exception: wrong number of arguments (given 3, expected 2) #28

Open
colinatkins opened this issue Jan 10, 2019 · 0 comments

Comments

@colinatkins
Copy link

Hi, I installed your gem, but haven't started to implement its functions.
I was working on a Model which saves file uploads together with the "acts-as-taggable-on" gem.
I couldn't save the model so I looked up the full trace:

polyamorous (1.3.3) lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb:58:in `join_constraints'
activerecord (5.2.2) lib/active_record/relation/query_methods.rb:1027:in `build_join_query'
activerecord (5.2.2) lib/active_record/relation/query_methods.rb:1009:in `build_joins'
baby_squeel (1.3.1) lib/baby_squeel/active_record/query_methods.rb:45:in `build_joins'
activerecord (5.2.2) lib/active_record/relation/query_methods.rb:929:in `build_arel'
activerecord (5.2.2) lib/active_record/relation/query_methods.rb:903:in `arel'
activerecord (5.2.2) lib/active_record/relation.rb:560:in `block in exec_queries'
activerecord (5.2.2) lib/active_record/relation.rb:584:in `skip_query_cache_if_necessary'
activerecord (5.2.2) lib/active_record/relation.rb:547:in `exec_queries'
activerecord (5.2.2) lib/active_record/association_relation.rb:34:in `exec_queries'
activerecord (5.2.2) lib/active_record/relation.rb:422:in `load'
activerecord (5.2.2) lib/active_record/relation.rb:200:in `records'
activerecord (5.2.2) lib/active_record/relation/delegation.rb:71:in `-'
acts-as-taggable-on (6.0.0) lib/acts_as_taggable_on/taggable/core.rb:258:in `block in save_tags'
acts-as-taggable-on (6.0.0) lib/acts_as_taggable_on/taggable/core.rb:227:in `each'
acts-as-taggable-on (6.0.0) lib/acts_as_taggable_on/taggable/core.rb:227:in `save_tags'
activesupport (5.2.2) lib/active_support/callbacks.rb:426:in `block in make_lambda'
activesupport (5.2.2) lib/active_support/callbacks.rb:236:in `block in halting_and_conditional'
activesupport (5.2.2) lib/active_support/callbacks.rb:517:in `block in invoke_after'
activesupport (5.2.2) lib/active_support/callbacks.rb:517:in `each'
activesupport (5.2.2) lib/active_support/callbacks.rb:517:in `invoke_after'
activesupport (5.2.2) lib/active_support/callbacks.rb:133:in `run_callbacks'
activesupport (5.2.2) lib/active_support/callbacks.rb:816:in `_run_save_callbacks'
activerecord (5.2.2) lib/active_record/callbacks.rb:342:in `create_or_update'
activerecord (5.2.2) lib/active_record/persistence.rb:273:in `save'
activerecord (5.2.2) lib/active_record/validations.rb:46:in `save'
activerecord (5.2.2) lib/active_record/transactions.rb:310:in `block (2 levels) in save'
activerecord (5.2.2) lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
activerecord (5.2.2) lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `block in transaction'
activerecord (5.2.2) lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/home/colin/.rbenv/versions/2.4.3/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
activerecord (5.2.2) lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
activerecord (5.2.2) lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `transaction'
activerecord (5.2.2) lib/active_record/transactions.rb:212:in `transaction'
activerecord (5.2.2) lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
activerecord (5.2.2) lib/active_record/transactions.rb:310:in `block in save'
activerecord (5.2.2) lib/active_record/transactions.rb:325:in `rollback_active_record_state!'
activerecord (5.2.2) lib/active_record/transactions.rb:309:in `save'
activerecord (5.2.2) lib/active_record/suppressor.rb:44:in `save'
app/controllers/backend/media_controller.rb:21:in `upload'
actionpack (5.2.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (5.2.2) lib/abstract_controller/base.rb:194:in `process_action'
actionpack (5.2.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.2.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (5.2.2) lib/active_support/callbacks.rb:109:in `block in run_callbacks'
route_translator (5.6.4) lib/route_translator/extensions/action_controller.rb:23:in `set_locale_from_url'
activesupport (5.2.2) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
activesupport (5.2.2) lib/active_support/callbacks.rb:136:in `run_callbacks'
actionpack (5.2.2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (5.2.2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (5.2.2) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (5.2.2) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.2) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.2) lib/active_support/notifications.rb:168:in `instrument'
actionpack (5.2.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (5.2.2) lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
activerecord (5.2.2) lib/active_record/railties/controller_runtime.rb:24:in `process_action'
actionpack (5.2.2) lib/abstract_controller/base.rb:134:in `process'
actionview (5.2.2) lib/action_view/rendering.rb:32:in `process'
actionpack (5.2.2) lib/action_controller/metal.rb:191:in `dispatch'
actionpack (5.2.2) lib/action_controller/metal.rb:252:in `dispatch'
actionpack (5.2.2) lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
actionpack (5.2.2) lib/action_dispatch/routing/route_set.rb:34:in `serve'
actionpack (5.2.2) lib/action_dispatch/journey/router.rb:52:in `block in serve'
actionpack (5.2.2) lib/action_dispatch/journey/router.rb:35:in `each'
actionpack (5.2.2) lib/action_dispatch/journey/router.rb:35:in `serve'
actionpack (5.2.2) lib/action_dispatch/routing/route_set.rb:840:in `call'
rack (2.0.6) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.0.6) lib/rack/etag.rb:25:in `call'
rack (2.0.6) lib/rack/conditional_get.rb:38:in `call'
rack (2.0.6) lib/rack/head.rb:12:in `call'
actionpack (5.2.2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.0.6) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.6) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/cookies.rb:670:in `call'
activerecord (5.2.2) lib/active_record/migration.rb:559:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.2) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.6) lib/rack/method_override.rb:22:in `call'
rack (2.0.6) lib/rack/runtime.rb:22:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.6) lib/rack/sendfile.rb:111:in `call'
webpacker (3.5.5) lib/webpacker/dev_server_proxy.rb:22:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (5.2.2) lib/rails/engine.rb:524:in `call'
puma (3.12.0) lib/puma/configuration.rb:225:in `call'
puma (3.12.0) lib/puma/server.rb:658:in `handle_request'
puma (3.12.0) lib/puma/server.rb:472:in `process_client'
puma (3.12.0) lib/puma/server.rb:332:in `block in run'
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread'

The following ArgumentException is thrown when the Models save-Method is called:
wrong number of arguments (given 3, expected 2)

After I removed the fine_print Gem the Exception disappeared. I check my Gemfile.lock and baby_squeel isn't used in any other gems.

I really like you Gem however I'm not sure how to fix this issue. Maybe your Gem can be refactored to eliminate the use of baby_squeel as it seems its just a different way of expressing SQL queries.

My Ruby Version was: 2.4.3
I am using Postgres.

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

1 participant