Created
December 24, 2018 05:04
-
-
Save abhianair/3a61ed14b5aa3f431a439a680e7d076d to your computer and use it in GitHub Desktop.
Switch all tenants created using apartment automatically and get data accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tenant = Apartment.tenant_names | |
@tenant.each do |name| | |
Apartment::Tenant.switch(name) do | |
@email = Account.pluck(:email) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment