Alexey Muranov wrote in post #1019182:
> This is a weird issue!
> @7stud, you should agree this is bug.
>

I don't know enough about rails to determine that.  Encoding issues are 
tricky.

>
> I have found out the difference between my application and this one.
>
> In the controller, instead of
>
>     MyModel.create!(:ip => request.remote_ip, :description => 'request')
>
> do
>
>     model = MyModel.new
>     model.save  # this is important!
>     model.ip = request.remote_ip
>     model.description = 'request'
>     model.save
>
> then it works.
>
> Alexey.

I can't duplicate the op's problem: I can't get sqlite3 to show 
X'3132372E302E302E31' for a string field.  It doesn't matter if I use 
create(), or new() and save().  I get the following in both cases:

sqlite> .dump users
BEGIN TRANSACTION;
CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 
"name" varchar(255), "email" varchar(255), "created_at" datetime, 
"updated_at" datetime, "last_sent_to" varchar(255));
INSERT INTO "users" VALUES(1,'127.0.0.1','request','2011-08-30 
11:43:08.702303','2011-08-30 11:43:08.702303',NULL);
INSERT INTO "users" VALUES(2,'127.0.0.1','string','2011-08-30 
11:43:08.710679','2011-08-30 11:43:08.710679',NULL);
COMMIT;
sqlite>

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: 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/rubyonrails-talk?hl=en.

Reply via email to