Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Replaced .symbolize with .to_sym in arel nodes. #70

Merged
merged 1 commit into from

2 participants

@omcnet

Without this patch the arel node classes ContainedWithinEquals and
ContainsEquals used .symbolize instead of .to_sym to crate the
operators. This causes a NoMethodError with: undefined method
`symbolize' for "<<=":String.
This patch addresses this issue by using to_sym instead of
symbolize.

@omcnet omcnet Replaced .symbolize with .to_sym in arel nodes.
Without this patch the arel node classes ContainedWithinEquals and
ContainsEquals used .symbolize instead of .to_sym to crate the
operators. This causes a NoMethodError with: undefined method
`symbolize' for "<<=":String.
This patch addresses this issue by using to_sym instead of
symbolize.
5978997
@danmcclain danmcclain merged commit dd03b08 into from
@danmcclain
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 14, 2013
  1. @omcnet

    Replaced .symbolize with .to_sym in arel nodes.

    omcnet authored
    Without this patch the arel node classes ContainedWithinEquals and
    ContainsEquals used .symbolize instead of .to_sym to crate the
    operators. This causes a NoMethodError with: undefined method
    `symbolize' for "<<=":String.
    This patch addresses this issue by using to_sym instead of
    symbolize.
This page is out of date. Refresh to see the latest.
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'")
Something went wrong with that request. Please try again.