In case you are modifying the Roles table (and then updating the new fields) you might want to reset the column information.
ModelName.reset_column_information ModelName is your case might be Role. -- Shiv On Sun, Dec 28, 2008 at 10:53 AM, Matt <matt.foxt...@gmail.com> wrote: > > The Roles table is being changed in this migration, but I alter the > table before I start working with the data. The two code blocks are > adjacent. The @developerRole code is immediately above it, and > @developerRole is created by > > @developerRole = Role.find(:first, :conditions => {:name => > 'Developer'}) > > Which happens immediately after the table alterations. > > On Dec 27, 8:24 pm, Frederick Cheung <frederick.che...@gmail.com> > wrote: > > Matt wrote: > > > puts ' -> Remove developer permissions collection' > > > @developerRole.permissions.delete_all > > > puts ' -> Set developer parent and list_priority' > > > @developerRole.update_attributes(:parent_id => > > > @officerRole.id, :list_priority => 5) > > > > > The migration handles that fine. However it throws an error on: > > > > > @serviceChair = Role.create :name => 'Service Chair' > > > @serviceChair.update_attributes(:parent_id => > > > @brotherRole.id, :list_priority => 3) > > > @serviceChair.permissions << @op_login > > > @serviceChair.permissions << @op_service_fundraising > > > > What (if any) is in between those two sections ? Are you changing the > > roles table in this migration ? Where does @developerRole come from ? > > > > Fred > > > -- George Carlin - "Weather forecast for tonight: dark." --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---