1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated calls from the tests

This commit is contained in:
Rafael Mendonça França 2013-12-05 00:18:22 -02:00
parent f1192f7428
commit 0507bc3f58
3 changed files with 9 additions and 9 deletions

View file

@ -62,8 +62,8 @@ module Arel
x.projections.length == 1 && Arel::Nodes::Count === x.projections.first
end
# fixme raise exception of there is no pk?
# fixme!! Table.primary_key will be depricated. What is the replacement??
# FIXME raise exception of there is no pk?
# FIXME!! Table.primary_key will be deprecated. What is the replacement??
def find_left_table_pk o, a
return visit o.primary_key, a if o.instance_of? Arel::Table
find_left_table_pk o.left, a if o.kind_of? Arel::Nodes::Join

View file

@ -45,7 +45,7 @@ module Arel
table = Table.new :users
fc = FakeCrudder.new
fc.from table
stmt = fc.compile_update [[table[:id], 'foo']], table.primary_key
stmt = fc.compile_update [[table[:id], 'foo']], Arel::Attributes::Attribute.new(table, 'id')
assert_instance_of Arel::UpdateManager, stmt
end
end

View file

@ -921,7 +921,7 @@ module Arel
manager = Arel::SelectManager.new engine
manager.from table
manager.take 1
stmt = manager.compile_update(SqlLiteral.new('foo = bar'), table.primary_key)
stmt = manager.compile_update(SqlLiteral.new('foo = bar'), Arel::Attributes::Attribute.new(table, 'id'))
stmt.key = table['id']
stmt.to_sql.must_be_like %{
@ -936,7 +936,7 @@ module Arel
manager = Arel::SelectManager.new engine
manager.from table
manager.order :foo
stmt = manager.compile_update(SqlLiteral.new('foo = bar'), table.primary_key)
stmt = manager.compile_update(SqlLiteral.new('foo = bar'), Arel::Attributes::Attribute.new(table, 'id'))
stmt.key = table['id']
stmt.to_sql.must_be_like %{
@ -950,7 +950,7 @@ module Arel
table = Table.new :users
manager = Arel::SelectManager.new engine
manager.from table
stmt = manager.compile_update(SqlLiteral.new('foo = bar'), table.primary_key)
stmt = manager.compile_update(SqlLiteral.new('foo = bar'), Arel::Attributes::Attribute.new(table, 'id'))
stmt.to_sql.must_be_like %{ UPDATE "users" SET foo = bar }
end
@ -961,7 +961,7 @@ module Arel
manager = Arel::SelectManager.new engine
manager.where table[:id].eq 10
manager.from table
stmt = manager.compile_update({table[:id] => 1}, table.primary_key)
stmt = manager.compile_update({table[:id] => 1}, Arel::Attributes::Attribute.new(table, 'id'))
stmt.to_sql.must_be_like %{
UPDATE "users" SET "id" = 1 WHERE "users"."id" = 10
@ -975,7 +975,7 @@ module Arel
manager.where table[:foo].eq 10
manager.take 42
manager.from table
stmt = manager.compile_update({table[:id] => 1}, table.primary_key)
stmt = manager.compile_update({table[:id] => 1}, Arel::Attributes::Attribute.new(table, 'id'))
stmt.to_sql.must_be_like %{
UPDATE "users" SET "id" = 1 WHERE "users"."id" IN (SELECT "users"."id" FROM "users" WHERE "users"."foo" = 10 LIMIT 42)
@ -987,7 +987,7 @@ module Arel
table = Table.new :users
manager = Arel::SelectManager.new engine
manager.from table
stmt = manager.compile_update({table[:id] => 1}, table.primary_key)
stmt = manager.compile_update({table[:id] => 1}, Arel::Attributes::Attribute.new(table, 'id'))
stmt.to_sql.must_be_like %{
UPDATE "users" SET "id" = 1