pg-app-name 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/pg-app-name.rb CHANGED
@@ -56,6 +56,10 @@ class ActiveRecord::ConnectionAdapters::ConnectionPool
56
56
  include PG::PoolApplicationName
57
57
  end
58
58
 
59
- if defined?(RAILS)
60
- ENV['PG_APP_NAME'] ||= Rails.application.class.name.split('::')[0].tableize rescue 'rails'
59
+ if defined?(Rails)
60
+ class PG::AppNameRailtie < Rails::Railtie
61
+ initializer 'pg-app-name-initializer', :before=>'active_record.set_configs' do
62
+ ENV['PG_APP_NAME'] ||= Rails.application.class.name.split('::')[0].tableize rescue 'rails'
63
+ end
64
+ end
61
65
  end
@@ -1,7 +1,7 @@
1
1
  module Pg
2
2
  module App
3
3
  module Name
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg-app-name
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-11 00:00:00.000000000 Z
12
+ date: 2012-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord