I'm trying to track down a bug, but I think it's related to my
previous post.
So far, this is what I'm doing:
class User < Sequel::Model(:public__users)
...
end
user = User.create(...)
and this fails with the following message:
/usr/local/lib/ruby/gems/1.8/gems/sequel-2.6.0/lib/sequel_model/
record.rb:198:in `refresh': Record not found (Sequel::Error)
Tracking down, it is inserting the data:
INSERT INTO "public"."users" ("active", "name", "password", "email",
"login") VALUES (true, 'User Name', '...', '[EMAIL PROTECTED]',
'the_user')
and then selecting the attributes:
SELECT pg_attribute.attname
FROM pg_class, pg_attribute, pg_index
WHERE pg_class.oid = pg_attribute.attrelid AND
pg_class.oid = pg_index.indrelid AND
pg_index.indkey[0] = pg_attribute.attnum AND
pg_index.indisprimary = 't' AND
pg_class.relname = 'public__users'
see... here the relname is public__users and not 'users' as it
should... :-(
So then, when it tries to fetch the new row from the database, it
fails:
SELECT * FROM "public"."dns_users" WHERE ("id" IS NULL) LIMIT 1
apparently because it didn't update the columns as required.
As this table name is not conflicting, if I change the model to
something like this:
class User < Sequel::Model(:users)
...
end
everything works just fine.
regards,
r./
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---