Ben Wilson
2008-Dec-08 01:24 UTC
Problem with Acts As Versioned and Save v. Save Without Revision
Okay, I had a legacy table that had no versioning. I added Acts As Versioned, by adding the "version" column to said database, and adding the acts_as_versioned to the model. When I tried to "save()" a record, I got an "uninitialized constant ActiveRecord::Table::Version" The field existed in the database, and the table_versions table was there. When I used "save_without_revision()", the record saved without a problem. Any clue on what I need to do to fix this? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
AndyV
2008-Dec-08 12:53 UTC
Re: Problem with Acts As Versioned and Save v. Save Without Revision
aav also requires an xxx_versions table (e.g., foo_versions if you''re versioning foos). Check the documentation; there''s a class-level method added to models that acts_as_versioned that will create the version table for you if you add it to a migration. On Dec 7, 8:24 pm, Ben Wilson <dau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Okay, I had a legacy table that had no versioning. I added Acts As > Versioned, by adding the "version" column to said database, and adding > the acts_as_versioned to the model. When I tried to "save()" a record, > I got an "uninitialized constant ActiveRecord::Table::Version" The > field existed in the database, and the table_versions table was there. > When I used "save_without_revision()", the record saved without a > problem. > > Any clue on what I need to do to fix this?--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ben Wilson
2008-Dec-15 02:29 UTC
Re: Problem with Acts As Versioned and Save v. Save Without Revision
Sorry for the delay answering. There is a xxx_versions table. Crud. I think I see the problem. This is a legacy db, which has a table named ''bases,'' which is a naughty table name. The singular is ''basis,'' which I can''t inflect because it''s a (kinda) reserved name. So, I guess I can magically rename the table "basis_versions" and fix it. I''ll give it a whirl. On Dec 8, 7:53 am, AndyV <AndyVana...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> aav also requires an xxx_versions table (e.g., foo_versions if you''re > versioning foos). Check the documentation; there''s a class-level > method added to models that acts_as_versioned that will create the > version table for you if you add it to a migration. > > On Dec 7, 8:24 pm, Ben Wilson <dau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Okay, I had a legacy table that had no versioning. I added Acts As > > Versioned, by adding the "version" column to said database, and adding > > the acts_as_versioned to the model. When I tried to "save()" a record, > > I got an "uninitialized constant ActiveRecord::Table::Version" The > > field existed in the database, and the table_versions table was there. > > When I used "save_without_revision()", the record saved without a > > problem. > > > Any clue on what I need to do to fix this?--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---