I'm having an issue with ruby on rails, and it not throwing an error
where it should.
I have a class 'clientpool' that is:
class Clientpool < ActiveRecord::Base
set_table_name "clientpool"
set_primary_key "id"
belongs_to :clients, :foreign_key => "cliname"
validates_presence_of :cliname
validates_associated :client
end
However, when I try to make a new clientpool, that has an invalid
cliname, that is not listed in clients, it will still create it and not
error out.
I see in the output log it does run the SQL to check, and the SQL
querry returns 0 rows, so it should error out, but it doesn't:
SQL (0.000088) BEGIN
Client Load (0.000115) SELECT * FROM clients WHERE (clients.id =
444) LIMIT 1
SQL (0.000279) INSERT INTO clientpool (`cliname`, `prefix`, `did`)
VALUES(444, 0, 0)
SQL (0.000072) COMMIT