lib/baby_squeel/active_record/query_methods.rb
# This is a monkey patch, and I'm not happy about it.
This is a monkey patch, and I'm not happy about it.
This is a monkey patch and I ' m not happy about it .
def build_joins(*args)
        if ::ActiveRecord::VERSION::MAJOR == 5 && ::ActiveRecord::VERSION::MINOR == 2
          args[1] = BabySqueel::JoinDependency::Injector5_2.new(args.second)
        elsif ::ActiveRecord::VERSION::MAJOR == 6 && ::ActiveRecord::VERSION::MINOR == 0
          args[1] = BabySqueel::JoinDependency::Injector6_0.new(args.second)
        else
          raise('This method or the Injector probably need to change')
        end
        super *args
      end
def build_joins ( * args ) if :: ActiveRecord :: VERSION :: MAJOR == 5 && :: ActiveRecord :: VERSION :: MINOR == 2 args [ 1 ] = BabySqueel :: JoinDependency :: Injector5_2 . new ( args . second ) elsif :: ActiveRecord :: VERSION :: MAJOR == 6 && :: ActiveRecord :: VERSION :: MINOR == 0 args [ 1 ] = BabySqueel :: JoinDependency :: Injector6_0 . new ( args . second ) else raise ( 'This method or the Injector probably need to change' ) end super * args end
This is a monkey patch, and I'm not happy about it.
This is a monkey patch and I ' m not happy about it .
# Active Record will call `group_by` on the `joins`. The # Injector has a custom `group_by` method that handles # BabySqueel::Join nodes. # Active Record will call `each` on the `joins`. The # Injector has a custom `each` method that handles # BabySqueel::Join nodes. # Please help baby_squeel to get ready for Rails 6.1. # I think you can start at this commits: # https://github.com/rails/rails/commit/c0c53ee9d28134757cf1418521cb97c4a135f140 # https://github.com/rails/rails/commit/f799f019641f432e9d1260e38846129b40f81d28 # We might monkey patch select_association_list instead of build_joins.
args