I am using ActiveRecord with oracle adapter on Ruby on Rails. I am getting a StatementInvalid Exception
when trying to delete a row.
Here is how my table looks like : room_user_table
room | user
1010 | a
1010 | b
1011 | a
1011 | c
1011 | d
My ruby ActiveRecord class:
class RoomUserTable < ActiveRecord:Base
self.table_name = 'room_user_table'
end
Now I want to delete the 2nd row for example, so I am issuing
RoomUserTable.destroy_all(:room => 1010, :user => 'b')
But this is throwing ActiveRecord::StatementInvalid Exception
OCIError: ORA-01741: illegal zero-length identifier: DELETE FROM "ROOM_USER_TABLE" WHERE "ROOM_USER_TABLE"."" = :a1
Any help would be much appreciated.
My test_controller.rb
class TestController < ActionController::Base
def test
RoomUserTable.destroy_all(:room => 1010, :user => 'b')
end
end