aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/visitor.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use class objects rather than strings for the dispatch cacheSean Griffin2014-11-181-14/+6
| | | | | | | | The only reason we're using strings is to pre-populate the cache, but `Class#name` returns a new string instance on every call. This is a pretty major source of memory usage. We don't technically need to pre-populate the cache, and not doing so allows us to go back to using cache objects
* cache the dispatch table on the depth first visitorAaron Patterson2014-11-101-6/+15
| | | | | We know the API for the depth first visitor in advance, so it's OK to calcuate this cache in advance
* oops! that should not have been checked inAaron Patterson2014-11-041-2/+1
|
* move the dispatch table to be per-instanceAaron Patterson2014-09-221-12/+19
| | | | | | | visitors are not shared among threads, so any mutations to the cache should be OK. The cache is also pre-populated on construction, but we should pull that out so we can share the cache among visitors in the future.
* push reduction visitors to a reduction base classAaron Patterson2014-04-081-4/+4
| | | | this lets our old depth first and dot visitors to work normally
* bind visitor working with collector objectAaron Patterson2014-04-081-4/+4
|
* removed the attribute that was left in for testingAlex Lin2014-03-251-1/+1
|
* Removed all the fiels in lib/arel/visitors/ which needs dependency on 'a' ↵Alex Lin2014-03-241-1/+1
| | | | also fixed the test case for : test/visitors/test_to_sql.rb:22 which pass in the parameter attribute e.g the parameter a.
* Fix warning of shadowing variableRafael Mendonça França2013-10-241-2/+2
|
* Cache visitor dispatch on a per-visitor basisColin Jones2013-08-141-3/+6
|
* Make visitors threadsafe by removing @last_columnErnie Miller2013-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | The last_column feature of the ToSql visitor and its descendants is what enabled quoting based on the column last visited -- in other words, if you have a standard condition like an equality with a string attribute on the left side and an integer on the right side, then when ARel visits the node, it'll first visit the left side attribute, setting the column of the string attribute as the last column, and resulting in the right side of the condition getting the appropriate quoting. The downside is that this means that visitors can't be shared between threads, because of the state mutation. It also makes for some really weird behavior in the event that the visitor visits a node that happens to contain an attribute you weren't expecting to be there, since it'll potentially quote something based on that attribute. So, it prevents reversing an equality condition. column = value will work, but not value = column, since the last column wouldn't be the column you're hoping for. This is a first pass at fixing this by changing the signature of the visit methods to accept the currently-relevant attribute, if any.
* visitors can define their own cache strategy for dispatch. fixes #57Aaron Patterson2011-06-271-4/+8
|
* visiting via superclass is OK, since module definitions help delegateAaron Patterson2011-01-041-1/+0
|
* fixing tests for oracle visitorAaron Patterson2011-01-031-1/+2
|
* make sure we raise type errors with unknown classesAaron Patterson2010-12-011-0/+1
|
* fixing tests in 1.9Aaron Patterson2010-11-301-1/+1
|
* adding deprecated support for walking ancestor treesAaron Patterson2010-11-301-0/+7
|
* adding a base class visitorAaron Patterson2010-10-191-0/+19