sinatra-activerecord 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sinatra/activerecord.rb +6 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a3137a17a6efe1acd0cd17bfd4460801a531108
4
- data.tar.gz: 6fae9c32465c409789020173d848f42f334812fe
3
+ metadata.gz: d77049a24680053ccad9e42f401efa5a689b5e45
4
+ data.tar.gz: ab9a5c361cf36e9782339df3cc4975b540842aef
5
5
  SHA512:
6
- metadata.gz: 201c0925d1a44358b5fcf3f39b99a539c988c98f1f052c27a77416e1c3f569e17f1964b006c57c315b80beb05e7c8d6780699a42aedf46523a6d4dcbea5cafa6
7
- data.tar.gz: ba49e78fb10532c1842136f8d2b89b2abf0b4552ae96ab3c17fd5e69e795a336aaaa6e669a60ec763a38cdcc4677d66e90a048309f8109948402c5e9519aeeed
6
+ metadata.gz: 3e129ec7fed328fbb62b279c9711ac63a4d41400b16cd741beb0653d31799cd0dec0ffc285e76c378760b504a2cedfa78e2fa0755f17299e4b043774acb661aa
7
+ data.tar.gz: c8572d6e5ee580682a97d1e85c17c4dfa6d8482a9ea53aa321324db78187004f5e1266f2d3687feaedffe816943e811e8821b864c21a9e6b4e5edbcc6b3ffc6a
@@ -16,8 +16,12 @@ module Sinatra
16
16
 
17
17
  module ActiveRecordExtension
18
18
  def self.registered(app)
19
- app.set :database_file, "#{Dir.pwd}/config/database.yml" if File.exist?("#{Dir.pwd}/config/database.yml")
20
- app.set :database, ENV['DATABASE_URL'] if ENV['DATABASE_URL']
19
+ if ENV['DATABASE_URL']
20
+ app.set :database, ENV['DATABASE_URL']
21
+ elsif File.exist?("#{Dir.pwd}/config/database.yml")
22
+ app.set :database_file, "#{Dir.pwd}/config/database.yml"
23
+ end
24
+
21
25
  unless defined?(Rake) || [:test, :production].include?(app.settings.environment)
22
26
  ActiveRecord::Base.logger = Logger.new(STDOUT)
23
27
  end
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: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Mizerany
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-25 00:00:00.000000000 Z
12
+ date: 2015-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra