Skip to content

Commit

Permalink
[#issue-27] set tenancy to false by default, and add some docs for te…
Browse files Browse the repository at this point in the history
…nancy support
  • Loading branch information
iffyuva committed Oct 28, 2014
1 parent 6200c54 commit 72740de
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,29 @@ has been renamed "Entry". To generate a migration which will update your databas

You only need to do this when upgrading a previously installed version of Plutus.


Multi-tenancy support
=====================

Plutus supports tenancy. All the accounts i.e `Plutus::Account` can be scoped to a
tenant. You have to follow these steps.

- Run a migration which adds `tenant_id` to all plutus accounts

```sh
bundle exec rails g plutus:tenancy
```

- Add an initializer which sets 2 variables on which plutus depends.

```ruby
Plutus.config do |config|
config.enable_tenancy = true
config.tenant_class = 'Tenant'
end
```


Overview
========

Expand Down
2 changes: 1 addition & 1 deletion lib/plutus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Engine < Rails::Engine
# ------------------------------ tenancy ------------------------------
# configuration to enable or disable tenancy
mattr_accessor :enable_tenancy
enable_tenancy = true
enable_tenancy = false

mattr_accessor :tenant_class
tenant_class = nil
Expand Down

0 comments on commit 72740de

Please sign in to comment.