Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

updated the documentation

  • Loading branch information...
commit d33bd39d13af01ec89c255615a755d6397697972 1 parent 6d80a93
@mattetti authored
Showing with 16 additions and 3 deletions.
  1. +13 −2
  2. +3 −1 lib/wd_sinatra_active_record.rb
@@ -69,9 +69,20 @@ Then in your `app.rb` after requiring this gem:
Then whichever `ActiveRecord` that needs to connect to the secondary DB
can inherit from `SecondaryConnection` instead of `ActiveRecord::Base`.
+A Rake task file is also provided so you can load ActiveRecord specific
+tasks. To do that, create a new rake file in your lib/tasks folder, load
+`WDSinatra` and the rake task file:
-A rake file with some tasks is also available but I won't support that
-feature for now.
+$ echo "WDSinatra::AppLoader.console(RAKE_APP_ROOT)
+load WdSinatraActiveRecord.task_path" > lib/tasks/db.rake
+The tasks are very basic and mainly copied from Rails, feel free to send
+patches and improvements.
+(Note: WDSinatra version older than 1.0.4 require that you update the
+Rakefile in your project.)
## Contributing
4 lib/wd_sinatra_active_record.rb
@@ -9,7 +9,9 @@ module WdSinatraActiveRecord
# Path to the rake task file so it can be loaded as such:
# load WdSinatraActiveRecord.task_path
- #
+ # (Note that the app loaded should have been started using something like:
+ # WDSinatra::AppLoader.console(RAKE_APP_ROOT)
+ # before loading this rake task.)
def self.task_path
File.join(File.expand_path(File.dirname(__FILE__), ".."), "wd_sinatra_active_record", "db.rake")
Please sign in to comment.
Something went wrong with that request. Please try again.