Commit 79477411ff724af60a2fd8869aa3b2350afb31bb
1 parent
a368d61a
Exists in
staging
and in
42 other branches
Uses YAML alias to reference default environment in multitenancy
Using the previous documented syntax got me an error since environment wasn't expected to be a string. I could only get it to work using YAML alias and anchors, so I'm changing the documentation.
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
INSTALL.multitenancy.md
... | ... | @@ -26,7 +26,7 @@ The file config/database.yml must follow a structure in order to achieve multite |
26 | 26 | |
27 | 27 | Each "hosted" environment must have an entry like this: |
28 | 28 | |
29 | - env1_production: | |
29 | + env1_production: &DEFAULT | |
30 | 30 | adapter: postgresql |
31 | 31 | encoding: unicode |
32 | 32 | database: noosfero |
... | ... | @@ -61,7 +61,7 @@ The "hosted" environments define, besides the `schema_search_path`, a list of do |
61 | 61 | You must also tell the application which is the default environment. |
62 | 62 | |
63 | 63 | production: |
64 | - env1_production | |
64 | + <<: *DEFAULT | |
65 | 65 | |
66 | 66 | On the example above there are only three hosted environments, but it can be more than three. The schemas `env2` and `env3` must already exist in the same database of the hosting environment. As postgres user, you can create them typing: |
67 | 67 | ... | ... |
config/database.yml.multitenancy
1 | 1 | # Refer to INSTALL.multitenancy for more information on Multitenancy support |
2 | -env1_production: | |
2 | +env1_production: &DEFAULT | |
3 | 3 | adapter: postgresql |
4 | 4 | encoding: unicode |
5 | 5 | database: noosfero |
... | ... | @@ -30,4 +30,4 @@ env3_production: |
30 | 30 | - env3.net |
31 | 31 | |
32 | 32 | production: |
33 | - env1_production | |
33 | + <<: *DEFAULT | ... | ... |