Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Fixnum values to be quoted #192

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/arel/visitors/to_sql.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ def quoted o, a
alias :visit_Hash :quoted alias :visit_Hash :quoted
alias :visit_NilClass :quoted alias :visit_NilClass :quoted
alias :visit_String :quoted alias :visit_String :quoted
alias :visit_Fixnum :quoted
alias :visit_Symbol :quoted alias :visit_Symbol :quoted
alias :visit_Time :quoted alias :visit_Time :quoted
alias :visit_TrueClass :quoted alias :visit_TrueClass :quoted
Expand Down
2 changes: 1 addition & 1 deletion test/nodes/test_equality.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def quote_table_name(*args) @quote_count += 1; super; end
attr = Table.new(:users)[:id] attr = Table.new(:users)[:id]
test = attr.eq(10) test = attr.eq(10)
test.to_sql engine test.to_sql engine
engine.connection.quote_count.must_equal 2 engine.connection.quote_count.must_equal 3
end end
end end
end end
Expand Down
4 changes: 4 additions & 0 deletions test/support/fake_record.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def columns_hash
def schema_cache def schema_cache
connection connection
end end

def quote *args
connection.quote *args
end
end end


class Base class Base
Expand Down