Permalink
Browse files

jdbcsqlite3 support added into template. #jruby

  • Loading branch information...
1 parent 6cea243 commit b335533e16436d1a12f15a60f6436bdc7b967012 @arunagw arunagw committed Apr 23, 2011
@@ -9,7 +9,8 @@
module Rails
module Generators
class AppBase < Base
- DATABASES = %w( mysql oracle postgresql sqlite3 frontbase ibm_db jdbcmysql )
+ JDBC_DATABASES = %w( jdbcmysql jdbcsqlite3 )
+ DATABASES = %w( mysql oracle postgresql sqlite3 frontbase ibm_db ) + JDBC_DATABASES
JAVASCRIPTS = %w( jquery prototype )
attr_accessor :rails_template
@@ -163,6 +164,7 @@ def gem_for_database
when "frontbase" then "ruby-frontbase"
when "mysql" then "mysql2"
when "jdbcmysql" then "activerecord-jdbcmysql-adapter"
+ when "jdbcsqlite3" then "activerecord-jdbcsqlite3-adapter"
else options[:database]
end
end
@@ -0,0 +1,17 @@
+# SQLite version 3.x
+# gem 'activerecord-jdbcsqlite3-adapter'
+
+development:
+ adapter: jdbcsqlite3
+ database: db/development.sqlite3
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: jdbcsqlite3
+ database: db/test.sqlite3
+
+production:
+ adapter: jdbcsqlite3
+ database: db/production.sqlite3
@@ -137,6 +137,12 @@ def test_config_jdbcmysql_database
assert_file "Gemfile", /^gem\s+["']activerecord-jdbcmysql-adapter["']$/
end
+ def test_config_jdbcsqlite3_database
+ run_generator([destination_root, "-d", "jdbcsqlite3"])
+ assert_file "config/database.yml", /jdbcsqlite3/
+ assert_file "Gemfile", /^gem\s+["']activerecord-jdbcsqlite3-adapter["']$/
+ end
+
def test_generator_if_skip_active_record_is_given
run_generator [destination_root, "--skip-active-record"]
assert_no_file "config/database.yml"

0 comments on commit b335533

Please sign in to comment.