Table Record on Sqlite3 DB Not Saving Updates

R

Rachel Nichol

Does anyone have an idea of why the record for wsc_sort_order does not
keep the value when I try to set it equal to 2 through console? Per
below? I am stumped also - when first creating the record I had a
value for wsc_uid_pk, however, as you can see it is nil.



=> #<Webservcat id: 2, wsc_uid_pk: nil, wsc_start_date: "2009-06-29",

wsc_active_fl: "Y", wsc_mult_serv_types_fl: "Y", wsc_sort_order: 1,

wsc_code: "INT", wsc_description: "INTERNET", wsc_end_date: nil,

wsc_system_code: "INT", created_at: "2009-06-29 20:01:43",
updated_at:

"2009-06-29 20:01:43">

=> 2

=> true

=> #<Webservcat id: 2, wsc_uid_pk: nil, wsc_start_date: "2009-06-29",

wsc_active_fl: "Y", wsc_mult_serv_types_fl: "Y", wsc_sort_order: 1,

wsc_code: "INT", wsc_description: "INTERNET", wsc_end_date: nil,

wsc_system_code: "INT", created_at: "2009-06-29 20:01:43",
updated_at:

"2009-06-29 20:01:43">
 
B

Brian Candler

I'm guessing, because you didn't say so, that this is ActiveRecord?
Remember that Ruby is not Rails, and you are on the Ruby mailing list
here.

Anyway:

* I believe you should use find(2) rather than find_by_id(2), although I
can't see why that would cause your problem.

* you haven't posted your class definition. Is it just

class Webservcat < ActiveRecord::Base; end

or have you done some other things in there?

* try turning on logging from ActiveRecord or at your database (you
didn't say what database you were using either) to check the SQL sent
and the results

* if you still can't solve it, better to ask again on a Rails mailing
list or group, with some more detail about your code, your database
setup, and the versions of ActiveRecord and Ruby you are using.

Regards,

Brian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top