sinatra-activerecord 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,21 +31,22 @@ module Sinatra
31
31
 
32
32
  def database_options
33
33
  url = URI(database_url)
34
- if url.scheme == "sqlite"
35
- {
36
- :adapter => "sqlite3",
37
- :database => url.host
38
- }
39
- else
40
- {
41
- :adapter => url.scheme,
42
- :host => url.host,
43
- :port => url.port,
44
- :database => url.path[1..-1],
45
- :username => url.user,
46
- :password => url.password
47
- }
48
- end.merge(database_extras)
34
+ options = {
35
+ :adapter => url.scheme,
36
+ :host => url.host,
37
+ :port => url.port,
38
+ :database => url.path[1..-1],
39
+ :username => url.user,
40
+ :password => url.password
41
+ }
42
+ case url.scheme
43
+ when "sqlite"
44
+ options[:adapter] = "sqlite3"
45
+ options[:database] = url.host
46
+ when "postgres"
47
+ options[:adapter] = "postgresql"
48
+ end
49
+ options.merge(database_extras)
49
50
  end
50
51
 
51
52
  def self.registered(app)
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'sinatra-activerecord'
6
- s.version = '0.1.1'
6
+ s.version = '0.1.2'
7
7
  s.date = '2009-09-21'
8
8
 
9
9
  s.description = "Extends Sinatra with activerecord helpers for instant activerecord use"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Mizerany