squeel icon indicating copy to clipboard operation
squeel copied to clipboard

Is 'visit_ActiveRecord_Base' no longer called?

Open bollard opened this issue 11 years ago • 0 comments

In v1.1.1 the following code was called:

  def visit_ActiveRecord_Base(o, parent)
    o.id
  end

In my application, i need to override this method on a per-class basis:

  def visit_ActiveRecord_Base(o, parent)
    o.class.persistent? ? o.persistent_id : o.id
  end

This method (and surprisingly visit) no longer appear to be called in my Rails 4.0.4 test suite upon having upgraded to v1.2.1 I have been stepping through the code but am unable to see the wood for the trees. Please can you clarify how Squeel selects the id of an ActiveRecord::Base object, specifically when performing a query like

Foo.where(:bar_id => Bar.last)

Thank you

bollard avatar Oct 27 '14 17:10 bollard