Skip to content

Instantly share code, notes, and snippets.

@tiagoefmoraes
Last active July 17, 2020 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagoefmoraes/e2319a75f82bdc136e2d95cf1cf01143 to your computer and use it in GitHub Desktop.
Save tiagoefmoraes/e2319a75f82bdc136e2d95cf1cf01143 to your computer and use it in GitHub Desktop.
Baby Squeel x ActiveRecord >= 5.2.1
raise on line: https://github.com/rails/rails/blob/7b5cc5a5dfcf38522be0a4b5daa97c5b2ba26c20/activerecord/lib/active_record/associations/join_dependency/join_association.rb#L58
RuntimeError:
now I have the table
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/associations/join_dependency/join_association.rb:58:in `tables='
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/associations/join_dependency.rb:145:in `block in construct_tables!'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/associations/join_dependency/join_part.rb:38:in `block in each_children'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/associations/join_dependency/join_part.rb:37:in `each'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/associations/join_dependency/join_part.rb:37:in `each_children'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/associations/join_dependency.rb:144:in `construct_tables!'
# /.gem/ruby/2.5.3/gems/polyamorous-2.3.2/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb:33:in `join_constraints'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/relation/query_methods.rb:1024:in `build_join_query'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/relation/query_methods.rb:1006:in `build_joins'
# ./lib/baby_squeel/active_record/query_methods.rb:56:in `build_joins'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/relation/query_methods.rb:926:in `build_arel'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/relation/query_methods.rb:900:in `arel'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/relation.rb:454:in `block in to_sql'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:206:in `unprepared_statement'
# /.gem/ruby/2.5.3/gems/activerecord-5.2.4.3/lib/active_record/relation.rb:454:in `to_sql'
# ./spec/support/matchers/sql_formatter.rb:27:in `normalize'
# ./spec/support/matchers/match_snapshot.rb:10:in `matches?'
# ./spec/integration/grouping_spec.rb:29:in `block (2 levels) in <top (required)>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment