Permalink
Browse files

Allow strings in from_value

  • Loading branch information...
1 parent 284f0bf commit 92c01948b5599ab7385613aff0dcba2fd3010459 @ernie ernie committed Oct 11, 2012
Showing with 27 additions and 0 deletions.
  1. +4 −0 CHANGELOG.md
  2. +3 −0 lib/squeel/visitors/from_visitor.rb
  3. +20 −0 spec/squeel/visitors/from_visitor_spec.rb
View
@@ -3,6 +3,10 @@
* Deprecated core extensions. In Squeel 2.0, the DSL will be the way to
construct queries, and Symbol/Hash extensions will go away.
+## 1.0.13 (2012-10-11)
+
+* Allow strings in from_value. Fixes incompatibility with acts-as-taggable-on.
+
## 1.0.12 (2012-10-07)
* Properly uniq order_values before visiting, to fix #163
@@ -1,6 +1,9 @@
module Squeel
module Visitors
class FromVisitor < Visitor
+
+ alias :visit_String :visit_passthrough
+
end
end
end
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+module Squeel
+ module Visitors
+ describe FromVisitor do
+
+ before do
+ @jd = new_join_dependency(Person, {}, [])
+ @c = Squeel::Adapters::ActiveRecord::Context.new(@jd)
+ @v = FromVisitor.new(@c)
+ end
+
+ it 'allows strings' do
+ from = @v.accept('people')
+ from.should eq 'people'
+ end
+
+ end
+ end
+end

0 comments on commit 92c0194

Please sign in to comment.