This is driving me crazy.. I’ve used a debugger, I’ve restarted my computer, the mysql server, the console, terminal, everything.. Why is the wrong value being stored in the database?
Here are the lines that write.. there are a few setters before this..
msg.contentID = twt.attrs["id_str"]
msg.save
Here is the debugger output:
SQL (0.4ms) INSERT INTO `messages` (`content`, `contentID`, `created_at`, `reply_to`, `sender_tid`, `updated_at`, `user_id`) VALUES (NULL, 84756616506912768, '2012-01-27 00:01:58', 'ZachACole', 115192457, '2012-01-27 00:01:58', 32)
(0.5ms) COMMIT
I immediately check the value in the database of contentID which should be ‘84756616506912768’.. and its not.. it’s a different value, but its the same different value every time… My message model has no validations on it.. as you can see here:
class Message < ActiveRecord::Base
belongs_to :user
scope :tweet, order("contentID desc")
end
How do I debug something like this?
============
Update: The value I get everytime is: 2147483647
Is the column in the database a BIGINT? A standard INT is too small to hold that number.