README.md in multitenant-0.4.1 vs README.md in multitenant-1.0.0
- old
+ new
@@ -9,9 +9,12 @@
```ruby
class User < ActiveRecord::Base
belongs_to :tenant
belongs_to_multitenant
+
+ validates :email, uniqueness: true # application-wide uniqueness
+ validates :alias, uniqueness: { scope: :tenant_id } # tenant-wide uniqueness
end
Multitenant.with_tenant current_tenant do
# queries within this block are automatically
# scoped to the current tenant