Jeremy, I'll take a look at making the changes you suggest, they look to be very helpful. I definitely see the problem with the foreign keys, but why did everything seem to work?
Scott On Thu, Jul 9, 2009 at 8:05 PM, Jeremy Evans <[email protected]> wrote: > > On Jul 9, 3:50 pm, Scott LaBounty <[email protected]> wrote: > > All, > > > > I have a new post up on creating a poll using Ramaze and Sequel. Let me > know > > what you think and if there are issues so I can fix them. > > > > http://steamcode.blogspot.com/2009/07/creating-poll-with-ramaze-and-s... > > I'd recommend using a second argument to foreign_key, which tells > which table the foreign_key references. Otherwise, no relationship is > created. > > foreign_key :poll_id, :polls > > drop_table takes multiple arguments (and you are dropping questions > instead of responses). You also want to drop responses before polls, > since responses references polls: > > drop_table(:responses, :polls) > > I don't recommend using the -M switch to bin/sequel, unless you > specifically do not want to upgrade to the latest version (which is > the default action without -M). > > sequel -m dbMigration/ sqlite://polls.db > > I generally load model files before controller files (since your > controllers reference your models and not vice-versa). In most of my > apps, I completely separate out the model related stuff so it can be > required separately (usually in a file called models.rb). The > advantage of this is you can get an irb shell with your models via: > > irb -r models.rb > > I'd remove the requiring rubygems and sequel from the poll.rb and > response.rb file, since the files are not useful by themselves. If > you tried to require just that file, you'd get an error because the > database connection hasn't been setup. > > Hope this helps, > Jeremy > > > -- Scott http://steamcode.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-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/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
