public
Description: A Ruby web application framework
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack.git
Click here to lend your support to: mack and make a donation at www.pledgie.com !
mack / lib / initialization / orm_support.rb
100644 20 lines (20 sloc) 0.948 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# If the application explicitly says it doesn't want to use any orm,
# then we're not going to initialize any default orm.
# Note: this is initialization process only. By the default, application
# generated by mack still have data_mapper as default.
orm = app_config.orm
unless orm.nil?
  Mack.logger.warn %{
Please note that setting up orm in app_config has been deprecated, and will not be supported in future mack releases.
Here's how to update your existing application:
1. Remove the line:
orm: data_mapper
from the app_config/default.yml file
2. In gem.rb, add the following line in the require_gems block:
gem.add "mack-data_mapper", :version => "0.6.0", :libs => ["mack-data_mapper"]
** if you use active record, then change it to mack-active_record instead of mack-data_mapper
}
  Mack.logger.info "Initializing #{orm} orm..."
  require "mack-#{orm}"
  require "mack-#{orm}_tasks"
end