On Dec 24, 11:28 am, Kally <[email protected]> wrote: > Hello, > I need help to set up Rails to be able to use sequel. I've searched > around, but unfortunately I need step by step instructions, and I > didn't find them. > I would like to use sequel in a rails 2.3.4 project. ActiveRecord > forces me to break best practices in database design and management. > Which usual features should I expect to work and which other not to > work?
Sequel works fine with Rails 2.3.4, as long as you don't use it with any of the ActiveRecord-specific functionality (rake db tasks, script/ generate model, ActiveRecordHelper, etc.). Just require sequel in environment.rb, and set up your database connection manually (Sequel.connect) in the appropriate environment files (development.rb/test.rb/production.rb). Your Sequel::Model class files go in app/models. > As far as I can understand migrations should, but what about > validations, path helpers, database session store, scaffolding? > Thank you very much in advance for any help. Rails migrations won't work, but you can use the bin/sequel command line tool (-m and -M options) to run Sequel's migrations. Path helpers it depends on whether you are using them with model objects. DB session stores probably not (use the CookieStore). Rails scaffolding probably not, but you can use scaffolding_extensions. Sequel's validation_class_methods plugin is very similar to ActiveRecord's default validations, but it's recommended to use the validation_helpers plugin. There is a rails_sequel extension that may make using Sequel with Rails easier, but I don't have experience with it. Jeremy -- 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.
