Browse files

Remove a passthrough for String.

Should be unnecessary to remove this, but this fixes #162 and I honestly
don't remember why I added the passthrough to begin with. ARel handles
quoting/escaping on String so passing it through from Squeel shouldn't
have an effect. Since no specs fail when I remove the line, I'm gonna
give myself a good slap on the wrist for writing code that isn't
justified by specs, remove the line, and close #162 in good conscience.
  • Loading branch information...
1 parent c4f5dd8 commit bd8d604fb145d1ef0fab2c2b1e1e7a0d47df3729 @ernie ernie committed Oct 7, 2012
Showing with 0 additions and 1 deletion.
  1. +0 −1 lib/squeel/visitors/visitor.rb
@@ -168,7 +168,6 @@ def visit_passthrough(object, parent)
alias :visit_Fixnum :visit_passthrough
alias :visit_Bignum :visit_passthrough
- alias :visit_String :visit_passthrough
# Visit an array, which involves accepting any values we know how to
# accept, and skipping the rest.

7 comments on commit bd8d604

blame ?

Hello Ernie,

We encountered a problem since you removed this line.

TypeError: Cannot visit String
/Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/squeel-1.0.12/lib/squeel/visitors/visitor.rb:154:in rescue in visit' /Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/squeel-1.0.12/lib/squeel/visitors/visitor.rb:147:invisit'
/Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/squeel-1.0.12/lib/squeel/visitors/visitor.rb:27:in accept' /Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/squeel-1.0.12/lib/squeel/adapters/active_record/relation_extensions.rb:22:inblock (2 levels) in module:RelationExtensions'
/Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/squeel-1.0.12/lib/squeel/adapters/active_record/3.2/relation_extensions.rb:29:in build_arel' /Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/relation/query_methods.rb:260:inarel'
/Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/relation.rb:171:in exec_queries' /Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/relation.rb:160:inblock in to_a'
/Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/explain.rb:40:in logging_query_plan' /Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/relation.rb:159:into_a'
/Users/ava/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in map' /Users/ava/git/tv-market/app/repositories/video_repository.rb:23:inrelated_by_tags'
/Users/ava/git/tv-market/test/unit/video/localization_test.rb:15:in `block in class:LocalizationTest'

Do you have any thoughts about moving it back?

BTW, we are using the last version of acts-as-taggable-on.


ernie replied Oct 10, 2012

Ok, I will first try to setup vanilla rails app with squeel and AATO. Then I will write you back with the results.


ernie replied Oct 10, 2012


ernie replied Oct 11, 2012

@av-ast So, the stack trace was a little misleading, since I saw the line referring to the order_values in build_arel (22), I missed that it was setting from_value, as well (27). I just pushed a fix to master, and am cherry-picking to 1-0-stable and releasing 1.0.13 momentarily.

@ernie thank you so much for your help! We really appreciate it. Now everything works fine.

Please sign in to comment.