apartment 0.22.0 → 0.22.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 633c827866f4356529e375c9fe6b1b2f8886dbf3
4
- data.tar.gz: 8b568ba43bbc49eb726ecc439b314b9c19c73ff3
3
+ metadata.gz: 0d86514c4d6c5f8dce97d40d42fb15b0728c1899
4
+ data.tar.gz: 896a629874de7e38e011439aecedc8a9d1e421e3
5
5
  SHA512:
6
- metadata.gz: 96084d067de04ce41892a639887c7ce2d248e556c1624879721f0bf4529348cf504f04c408f7f82a6cbb17366078d48b542bf75f5b569cd32f85b684ff380739
7
- data.tar.gz: 1173968bbe02e081870bba50bbbab33775e16a6f42e213b34bb15b0a47929fe1d8dcc8ca83eca243669ded99a8dd9a52d1cf46e49d995fb62209b0f877d71336
6
+ metadata.gz: 1748af36194e004026605133a90b994668b0abff22a2d0daeeef284cdf331491befc373aa6a498a20467ba7e97bf1644572b91d7183965ca550369f590801ddb
7
+ data.tar.gz: c746e001bce3d931773a929134162fc5c80ec915623cdc04371beeef19ce26b12bc079e3ed27013d0ddbca32f09469dfd5774ea439648ee1865996f3b50d981b
data/HISTORY.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.22.1
2
+ * August 21, 2013
3
+
4
+ - Fix bug where if your ruby process importing the database schema is run
5
+ from a directory other than the app root, Apartment wouldn't know what
6
+ schema_migrations to insert into the database (Rails only)
7
+
1
8
  # 0.22.0
2
9
  * June 9, 2013
3
10
 
data/README.md CHANGED
@@ -191,6 +191,20 @@ schema_search_path: "public,hstore"
191
191
 
192
192
  This would be for a config with `default_schema` set to `public` and `persistent_schemas` set to `['hstore']`
193
193
 
194
+ Another way that we've successfully configured hstore for our applications is to add it into the
195
+ postgresql template1 database so that every db that gets created has it by default.
196
+
197
+ You can do so using a command like so
198
+
199
+ ```bash
200
+ psql -U postgres -d template1 -c "CREATE SCHEMA hstore AUTHORIZATION some_username;"
201
+ psql -U postgres -d template1 -c "CREATE EXTENSION IF NOT EXISTS hstore SCHEMA hstore;"
202
+ ```
203
+
204
+ The *ideal* setup would actually be to install `hstore` into the `public` schema and leave the public
205
+ schema in the `search_path` at all times. We won't be able to do this though until public doesn't
206
+ also contain the tenanted tables, which is an open issue with no real milestone to be completed.
207
+ Happy to accept PR's on the matter.
194
208
 
195
209
  ### Managing Migrations
196
210
 
@@ -73,7 +73,7 @@ module Apartment
73
73
  #
74
74
  def connect_to_new(database = nil)
75
75
  return reset if database.nil?
76
- raise ActiveRecord::StatementInvalid.new unless Apartment.connection.schema_exists? database
76
+ raise ActiveRecord::StatementInvalid.new("Could not find schema #{database}") unless Apartment.connection.schema_exists? database
77
77
 
78
78
  @current_database = database.to_s
79
79
  Apartment.connection.schema_search_path = full_search_path
@@ -16,6 +16,8 @@ module Apartment
16
16
  config.prepend_environment = false
17
17
  config.append_environment = false
18
18
  end
19
+
20
+ ActiveRecord::Migrator.migrations_paths = Rails.application.paths['db/migrate'].to_a
19
21
  end
20
22
 
21
23
  # Hook into ActionDispatch::Reloader to ensure Apartment is properly initialized
@@ -1,3 +1,3 @@
1
1
  module Apartment
2
- VERSION = "0.22.0"
2
+ VERSION = "0.22.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apartment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Brunner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-09 00:00:00.000000000 Z
12
+ date: 2013-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -54,15 +54,11 @@ files:
54
54
  - .ruby-gemset
55
55
  - .ruby-version
56
56
  - .travis.yml
57
- - .vagrant
58
- - Cheffile
59
- - Cheffile.lock
60
57
  - Gemfile
61
58
  - HISTORY.md
62
59
  - README.md
63
60
  - Rakefile
64
61
  - TODO.md
65
- - Vagrantfile
66
62
  - apartment.gemspec
67
63
  - circle.yml
68
64
  - lib/apartment.rb
data/.vagrant DELETED
@@ -1 +0,0 @@
1
- {"active":{"default":"c780c5fa-2739-4d9a-be05-2f4f6c1dcea6"}}
data/Cheffile DELETED
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #^syntax detection
3
-
4
- site 'http://community.opscode.com/api/v1'
5
-
6
- # cookbook 'chef-client'
7
-
8
- # cookbook 'apache2', '>= 1.0.0'
9
-
10
- cookbook 'apt'
11
- cookbook 'build-essential'
12
- cookbook 'openssl'
13
-
14
- cookbook 'postgresql'
15
- cookbook 'mysql'
16
-
17
- cookbook 'git'
18
-
19
- cookbook 'rvm',
20
- :git => 'https://github.com/fnichol/chef-rvm'
21
-
22
- # cookbook 'postgresql',
23
- # :git => 'https://github.com/findsyou/cookbooks',
24
- # :ref => 'postgresql-improvements'
data/Cheffile.lock DELETED
@@ -1,43 +0,0 @@
1
- SITE
2
- remote: http://community.opscode.com/api/v1
3
- specs:
4
- apt (1.9.0)
5
- build-essential (1.3.4)
6
- chef_gem (0.0.5)
7
- chef_handler (1.1.4)
8
- dmg (1.1.0)
9
- git (2.3.0)
10
- build-essential (>= 0.0.0)
11
- dmg (>= 0.0.0)
12
- runit (~> 1.0)
13
- windows (>= 0.0.0)
14
- yum (>= 0.0.0)
15
- mysql (2.1.2)
16
- build-essential (>= 0.0.0)
17
- openssl (>= 0.0.0)
18
- openssl (1.0.2)
19
- postgresql (2.2.2)
20
- openssl (>= 0.0.0)
21
- runit (1.1.0)
22
- build-essential (>= 0.0.0)
23
- windows (1.8.4)
24
- chef_handler (>= 0.0.0)
25
- yum (2.1.0)
26
-
27
- GIT
28
- remote: https://github.com/fnichol/chef-rvm
29
- ref: master
30
- sha: 37ae6f0d6540ebc95d22004d68dd45fe304d7255
31
- specs:
32
- rvm (0.9.1)
33
- chef_gem (>= 0.0.0)
34
-
35
- DEPENDENCIES
36
- apt (>= 0)
37
- build-essential (>= 0)
38
- git (>= 0)
39
- mysql (>= 0)
40
- openssl (>= 0)
41
- postgresql (>= 0)
42
- rvm (>= 0)
43
-
data/Vagrantfile DELETED
@@ -1,112 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- Vagrant::Config.run do |config|
5
- # All Vagrant configuration is done here. The most common configuration
6
- # options are documented and commented below. For a complete reference,
7
- # please see the online documentation at vagrantup.com.
8
-
9
- # Every Vagrant virtual environment requires a box to build off of.
10
- config.vm.box = "precise32-12.04"
11
-
12
- # The url from where the 'config.vm.box' box will be fetched if it
13
- # doesn't already exist on the user's system.
14
- config.vm.box_url = "http://files.vagrantup.com/precise32.box"
15
-
16
- # Boot with a GUI so you can see the screen. (Default is headless)
17
- # config.vm.boot_mode = :gui
18
-
19
- # Assign this VM to a host-only network IP, allowing you to access it
20
- # via the IP. Host-only networks can talk to the host machine as well as
21
- # any other machines on the same network, but cannot be accessed (through this
22
- # network interface) by any external networks.
23
- # config.vm.network :hostonly, "192.168.33.10"
24
-
25
- # Assign this VM to a bridged network, allowing you to connect directly to a
26
- # network using the host's network device. This makes the VM appear as another
27
- # physical device on your network.
28
- # config.vm.network :bridged
29
-
30
- # Forward a port from the guest to the host, which allows for outside
31
- # computers to access the VM, whereas host only networking does not.
32
- # config.vm.forward_port 80, 8080
33
-
34
- # Share an additional folder to the guest VM. The first argument is
35
- # an identifier, the second is the path on the guest to mount the
36
- # folder, and the third is the path on the host to the actual folder.
37
- # config.vm.share_folder "v-data", "/vagrant_data", "../data"
38
-
39
- # Enable provisioning with chef solo, specifying a cookbooks path, roles
40
- # path, and data_bags path (all relative to this Vagrantfile), and adding
41
- # some recipes and/or roles.
42
- #
43
- config.vm.provision :chef_solo do |chef|
44
- chef.cookbooks_path = "cookbooks"
45
-
46
- # chef.roles_path = "recipes/roles"
47
- # chef.data_bags_path = "../my-recipes/data_bags"
48
- chef.add_recipe "apt"
49
-
50
- chef.add_recipe "mysql"
51
- chef.add_recipe "mysql::server"
52
- chef.add_recipe "postgresql"
53
- chef.add_recipe "postgresql::server"
54
-
55
- chef.add_recipe "rvm::vagrant"
56
- chef.add_recipe "rvm::user"
57
- chef.add_recipe "git"
58
- # chef.add_role "web"
59
- #
60
- # # You may also specify custom JSON attributes:
61
- chef.json = {
62
- mysql: {
63
- version: '5.5',
64
- server_root_password: "",
65
- server_repl_password: "",
66
- server_debian_password: ""
67
- },
68
- postgresql: {
69
- version: '9.1',
70
- password: {
71
- postgres: ''
72
- },
73
- pg_hba: [
74
- {type: 'local', db: 'all', user: 'all', addr: nil, method: 'trust'},
75
- {type: 'host', db: 'all', user: 'all', addr: '127.0.0.1/32', method: 'trust'},
76
- {type: 'host', db: 'all', user: 'all', addr: '::1/128', method: 'trust'}
77
- ]
78
- },
79
- rvm: {
80
- user_default_ruby: 'ruby-1.9.3-p392',
81
- user_installs: [{
82
- user: 'vagrant',
83
- default_ruby: 'ruby-1.9.3-p392@apartment',
84
- versions: %w{1.9.3-p392}
85
- }]
86
- }
87
- }
88
- end
89
-
90
- # Enable provisioning with chef server, specifying the chef server URL,
91
- # and the path to the validation key (relative to this Vagrantfile).
92
- #
93
- # The Opscode Platform uses HTTPS. Substitute your organization for
94
- # ORGNAME in the URL and validation key.
95
- #
96
- # If you have your own Chef Server, use the appropriate URL, which may be
97
- # HTTP instead of HTTPS depending on your configuration. Also change the
98
- # validation key to validation.pem.
99
- #
100
- # config.vm.provision :chef_client do |chef|
101
- # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
102
- # chef.validation_key_path = "ORGNAME-validator.pem"
103
- # end
104
- #
105
- # If you're using the Opscode platform, your validator client is
106
- # ORGNAME-validator, replacing ORGNAME with your organization name.
107
- #
108
- # IF you have your own Chef Server, the default validation client name is
109
- # chef-validator, unless you changed the configuration.
110
- #
111
- # chef.validation_client_name = "ORGNAME-validator"
112
- end