Skip to content

andoriyu/grape-activerecord

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grape-activerecord

This gem is modeled after sinatra-activerecord and it's main purpose is to make sure that AR database connections are released correctly.

USAGE:

Add the following line to your Gemfile and run bundle.

 gem :grape-activerecord

In your Grape::API class you will want to include the following:

 class YourGrapeAPP < Grape::API
   include Grape::ActiveRecordExtension

   # your route logic below
 end

Your application will now have the Grape #after filter setup to call ActiveRecord::clear_active_connections!

The gem also provides some useful database rake tasks:

  • rake db:create_migration # create an ActiveRecord migration
  • rake db:migrate # migrate the database (use version with VERSION=n)
  • rake db:rollback # roll back the migration (use steps with STEP=n)
  • rake db:schema:dump # dump schema into file
  • rake db:schema:load # load schema into database

About

Library to help deal with AR connection pools and add common db rake tasks for Grape API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%