Skip to content
Newer
Older
100644 87 lines (52 sloc) 3.45 KB
4cabc1f @brasten Initial sequel-rails commit
authored
1 = sequel-rails
2
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
3 This gem provides the railtie that allows {sequel}[http://github.com/jeremyevans/sequel] to hook into {rails3}[http://github.com/rails/rails] and thus behave like a rails framework component. Just like activerecord does in rails, {sequel-rails}[http://github.com/brasten/sequel-rails] uses the railtie API to hook into rails. The two are actually hooked into rails almost identically.
4cabc1f @brasten Initial sequel-rails commit
authored
4
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
5 The code for this gem was initially taken from the excellent {dm-rails}[http://github.com/datamapper/dm-rails] project.
4cabc1f @brasten Initial sequel-rails commit
authored
6
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
7 == Using sequel-rails
4cabc1f @brasten Initial sequel-rails commit
authored
8
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
9 Using sequel with rails3 requires a couple minor changes.
4cabc1f @brasten Initial sequel-rails commit
authored
10
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
11 First, add the following to your Gemfile:
4cabc1f @brasten Initial sequel-rails commit
authored
12
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
13 gem 'sequel-rails'
14
15 ... be sure to run "bundle install" if needed!
4cabc1f @brasten Initial sequel-rails commit
authored
16
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
17 Secondly, you'll need to require "sequel-rails/railtie" in your config/application.rb file, and not require activerecord. The top of your config/application.rb will probably look something like:
18
19 # require 'rails/all'
20
21 # Instead of 'rails/all', require these:
22 require "action_controller/railtie"
23 require "sequel-rails/railtie"
24 require "action_mailer/railtie"
4cabc1f @brasten Initial sequel-rails commit
authored
25
26
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
27 After those changes, you should be good to go!
4cabc1f @brasten Initial sequel-rails commit
authored
28
29
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
30 == Available sequel specific rake tasks
4cabc1f @brasten Initial sequel-rails commit
authored
31
32 To get a list of all available rake tasks in your rails3 app, issue the usual
33
34 vendor/bin/rake -T
35
36 Once you do that, you will see the following rake tasks among others. These are the ones that sequel-rails added for us.
37
38 ...
39 vendor/bin/rake db:create # Create the database(s) defined in config/database.yml for the current Rails.env - also creates the test database(s) if Rails.env.development?
40 vendor/bin/rake db:create:all # Create all the local databases defined in config/database.yml
41 vendor/bin/rake db:drop # Drops the database(s) for the current Rails.env - also drops the test database(s) if Rails.env.development?
42 vendor/bin/rake db:drop:all # Drop all the local databases defined in config/database.yml
43 vendor/bin/rake db:migrate # Migrate the database to the latest version
44 vendor/bin/rake db:migrate:down[version] # Migrate down using migrations
45 vendor/bin/rake db:migrate:up[version] # Migrate up using migrations
46 vendor/bin/rake db:seed # Load the seed data from db/seeds.rb
47 vendor/bin/rake db:sessions:clear # Clear the sessions table for SequelStore
48 vendor/bin/rake db:sessions:create # Creates the sessions table for SequelStore
49 vendor/bin/rake db:setup # Create the database, load the schema, and initialize with the seed data
50 ...
51
52
53 == Current Issues
54
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
55 * There are bound to be a lot, but I'm not yet sure what they are
4cabc1f @brasten Initial sequel-rails commit
authored
56
57 == TODO (not necessarily in that order)
58
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
59 * SPECS
60 * README changes
61 * Publish SQL issued by sequel to rails subscribers
4cabc1f @brasten Initial sequel-rails commit
authored
62
63 == Credits
64
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
65 The {dm-rails}[http://github.com/datamapper/dm-rails] team wrote most of this code, I just sequel-ized it.
66
4cabc1f @brasten Initial sequel-rails commit
authored
67
68
69 == Note on Patches/Pull Requests
70
71 * Fork the project.
72 * Make your feature addition or bug fix.
73 * Add tests for it. This is important so I don't break it in a
74 future version unintentionally.
75 * Commit, do not mess with rakefile, version, or history.
76 (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
77 * Send me a pull request. Bonus points for topic branches.
78
79
80 == The sequel-rails team
81
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
82 * Brasten Sager (brasten)
4cabc1f @brasten Initial sequel-rails commit
authored
83
84 == Copyright
85
ce288f2 @brasten README file changes; stripped dm-rails-specific language; migrations
authored
86 Copyright (c) 2010 The sequel-rails team. See {LICENSE}[http://github.com/brasten/sequel-rails/blob/master/LICENSE] for details.
Something went wrong with that request. Please try again.