Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #70 from omcnet/fix-arel-node-operators

Replaced .symbolize with .to_sym in arel nodes.
  • Loading branch information...
commit dd03b08171916a6e0559e20163fd28f9a89b0a34 2 parents 2033a4a + 5978997
@danmcclain danmcclain authored
View
4 lib/postgres_ext/arel/nodes/contained_within.rb
@@ -6,7 +6,7 @@ def operator; :<< end
end
class ContainedWithinEquals < Arel::Nodes::Binary
- def operator; '<<='.symbolize end
+ def operator; '<<='.to_sym end
end
class Contains < Arel::Nodes::Binary
@@ -14,7 +14,7 @@ def operator; :>> end
end
class ContainsEquals < Arel::Nodes::Binary
- def operator; '>>='.symbolize end
+ def operator; '>>='.to_sym end
end
end
end
View
15 spec/arel/inet_spec.rb
@@ -17,6 +17,21 @@ class IpAddress < ActiveRecord::Base
Object.send(:remove_const, :IpAddress)
end
+ describe "arel node operators",:wip => true do
+ it "ContainedWithin" do
+ Arel::Nodes::ContainedWithin.new(nil,nil).operator.should == :<<
+ end
+ it "ContainedWithinEquals" do
+ Arel::Nodes::ContainedWithinEquals.new(nil,nil).operator.should == '<<='.to_sym
+ end
+ it "ContainedWithinEquals" do
+ Arel::Nodes::Contains.new(nil,nil).operator.should == :>>
+ end
+ it "ContainedWithinEquals" do
+ Arel::Nodes::ContainsEquals.new(nil,nil).operator.should == '>>='.to_sym
+ end
+ end
+
describe 'quoting IPAddr in sql statement' do
it 'properly converts IPAddr to quoted strings when passed as an argument to a where clause' do
IpAddress.where(:address => IPAddr.new('127.0.0.1')).to_sql.should include("'127.0.0.1/32'")
Please sign in to comment.
Something went wrong with that request. Please try again.