Francisco Quinones


7,390 Experience
40 Lessons Completed
2 Questions Solved


quick question cron jobs run normal on Multitenancy app
This the code that I have if it dont run normal I was think of doing the block code so it runs in each tanent

  # Company.all.each  do |c|
  # Apartment::Tenant.switch!('c.subdomain')
   every 1.month, :at => '1st 6:00am' do
        runner "User.email_task_list"
        runner "Task.generate_new_trans" # class Task.method
    # end

Posted in What is the spinning icon I see on GoRails?

@chris can we use this on are production apps???

Posted in Activity Feed From Scratch Discussion

Love it keep it up Chris

OMG! found it I was using

  user_name:            'USERNAME',
   password:             'PASSWORD',

and not this

   user_name:       ENV['USERNAME'],
   password:          ENV['PASSWORD'],

Thank you thank you

I got this in the terminal
Net::SMTPAuthenticationError (535-5.7.8 Username and Password not accepted. Learn more at):

Ok I get back to you on that thank you very much! Chris keep up the good work love everything that your doing. will recommend you!

Chris Love it I need it this a year ago but love to learn your approach on this

Hi! any more info that you need let me know as im looking to fix this problem. Thank Chris as always.


 config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
  # config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :letter_opener
  # config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address:              '',
    port:                 '587',
    domain:               '',
    user_name:            'USERNAME',
    password:             'PASSWORD',
    authentication:       'plain',
    enable_starttls_auto: true  }


  config.action_mailer.default_url_options = { host: ''}
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = false
  config.action_mailer.default :charset => "utf-8"
  config.action_mailer.smtp_settings = {
    address:              '',
    port:                 587,
    domain:               '',
    user_name:            'USERNAME',
    password:             'PASSWORD',
    authentication:       'plain',
    enable_starttls_auto: true  }

Hi I did the Multitenancy app works great only problem that im having is on production the app wont send email. On local machine it send it with no problem.
Any help and what info that you need let me know thank you.

Posted in Multitenancy with the Apartment gem

I think im goin to try sidekiq. :)

Posted in Multitenancy with the Apartment gem

Chris you're a lifesaver as always I look at how can I call the on the authentication methond
I need to edit this so it use the subdomain

def self.find_for_database_authentication(warden_conditions)
conditions = warden_conditions.dup
if login = conditions.delete(:login)
where(conditions.to_h).where(["lower(username) = :value OR lower(email) = :value", { :value => login}]).first

. On the background Job I got it setup with delayed_job is theres a way of using it or I have to move to sidekiq.

Posted in Multitenancy with the Apartment gem

Hi! @chris oliver I got the multitenant app running local and manage to create the subdomain and tranfer data from the public schema to the subdomain one. Now I got 2 problems the first one is I need to verify the user belongs to that subdomain but I dont know how to do this as the subdomain is in the company table. Here they use the user table for the scope.
and the second problem that I got is the background jobs are not running is there any setting that I have to do. Thank you for any help

Posted in Multitenancy with the Apartment gem

Hi Chris Im trying to apply the Multitenancy to a exiting app. at the moment the tenant get create. how can I use the exiting that to be one of the tenant. When I enter with a exiting user to the tenant I get error because is looking for data that doesnot exit in that DBs.
Im using devise and have the subdomain in the company and not the user model.
Thank. uf you need more info just let me know.

Thank Chris for the quick response. and Yes I saw that one and looks pretty nasty for a solution. On my app im using a User Model and 2 User type ServiceUser and ClientUser that belongs to the User Model. I think this a better solution for getting Devise and Multitenancy working fast and without any hacks.

Hi im trying to have 3 type of devise users but one to have a single login. I need to find a way to make the routes to go to a site/login for all 3 of then.
Im not using the 1 User model with 3 type of User like roles beacuse each of the type of user has he's on role types. example: Admin has 3 rols Admin, Super Admin and Moderator.

Posted in Multitenancy with the Apartment gem Discussion

Can I do this with company. So when I create a company the company gets the subdomain. and do something like to look for the tenant ??? as my app is goin to have User model and Admin model. Admin will create the Companies and User for the companies

Posted in filter child record by the parent.

wow super this a big step for me. thank you for your time. next Multitenancy.

Posted in filter child record by the parent.

Thank I found a way to do it but its going to make the file to big can I create some tipe of partical like??
So I can clean the class ability

class Ability
  include CanCan::Ability
  include super_admin_ability
  def initialize(user)
    if user.role == "super_admin"

Class SuperAdminAbility
    def super_admin_ability
      can :manage, [ServiceCompany,User]

Posted in filter child record by the parent.

thank you ill look at it :)

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.