- Implement support for polymorphic tenant
- Ability to use acts_as_tenant with only ActiveRecord (no Rails)
- Allow setting of custom primary key
- Bug fixes
- allow 'optional' relations
- Sidekiq fixes
- Replace all
before_filter
withbefore_action
for Rails 5.1 compatibility
- Removed (stale, no longer working) MongoDB support; moved code to separate branch
- Added without_tenant option (see readme, thx duboff)
- (Sub)domain lookup is no longer case insensitive
- Added ability to use inverse_of (thx lowjoel)
- Added ability to disable tenant checking for a block (thx duboff)
- Allow for validation that associations belong to the tenant to reflect on associations which return an Array from
where
(thx ludamillion)
- Added ability to configure a default tenant for testing purposes. (thx iangreenleaf)
- AaT will now accept a string for a tenant_id (thx calebthompson)
- Improvements to readme (thx stgeneral)
- Added Mongoid compatibility [thx iangreenleaf]
- Fix for proper handling of polymorphic associations (thx sol1dus)
- Fix fefault scope to generate correct sql when using database prefix (thx IgorDobryn)
- Added ability to specify a custom Primary Key (thx matiasdim)
- Sidekiq 3.2.2+ no longer supports Ruby 1.9. Locking Sidekiq in gemspec at 3.2.1.
- Update RSPEC to 3.0. Convert all specs (thx petergoldstein)
- support sidekiq 3 interface (thx davekaro)
- Added method
set_current_tenant_by_subdomain_or_domain
(thx preth00nker)
- Fix to degredation introduced after 3.1 that prevented tenant_id from being set during initialization (thx jorgevaldivia)
- Fix to a bug introduced in 0.3.2
- Support user defined foreign keys on scoped models
- correctly support nested models with has_many :through (thx dexion)
- Support 'www.subdomain.example.com' (thx wtfiwtz)
- Support setting
tenant_id
on scoped models if thetenant_id
is nil (thx Matt Wilson)
- Added support for Rails 4
- You can now raise an exception if a query on a scope model is made without a tenant set. Adding an initializer that sets config.require_tenant to true will accomplish this. See readme for more details.
ActsAsTenant.with_tenant
will now return the value of the block it evaluates instead of the original tenant. The original tenant is restored automatically.- acts_as_tenant now raises standard errors which can be caught individually.
set_current_tenant_to
, which was deprecated some versions ago and could lead to weird errors, has been removed.
- Added support for many-to-many associations (thx Nucleoid)
- Added dependencies to gemspec (thx aaronrenner)
- Added the
ActsAsTenant.with_tenant
block method (see readme) (thx aaronrenner) - Acts_as_Tenant is now thread safe (thx davide)
- Changed the interface for passing in the current_tenant manually in the controller.
set_current_tenant_to
has been deprecated and replaced byset_current_tenant_through_filter
declaration and theset_current_tenant
method. See readme for details.
- Fixed a bug with resolving the tenant model name (thx devton!)
- Added support for using relations: User.create(:account => Account.first) now works, while it wouldn't before (thx bnmrrs)
- Added Rails 3.2 compatibility (thx nickveys!)
- Added correct handling of child models that do not have their parent set (foreign key == nil)
- Added support for models that declare a has_one relationships, these would error out in the previous versions.
- Enhancements
- Added support for aliased associations ( belongs_to :something, :class_name => 'SomethingElse'). In previous version these would raise an 'uninitialized constant' error.
- Initial release