Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milia gem doesn't uploaded #89

Open
kashtech79 opened this issue May 6, 2020 · 2 comments
Open

Milia gem doesn't uploaded #89

kashtech79 opened this issue May 6, 2020 · 2 comments

Comments

@kashtech79
Copy link

Please help me if you can, this is my last attempt on Rails, like all other former Rails programmer I'll have no choice to leave Rails.

I use Rails 6

my gemfile

gem 'pg', '>= 0.18', '< 2.0'
gem 'devise'
gem 'milia'

ApplicationController.rb

class ApplicationController < ActionController::Base
before_action :authenticate_tenant!
end

Error generate

/home/kash/.rvm/gems/ruby-2.7.0/gems/activerecord-6.0.2.2/lib/active_record/type.rb:27:
warning: Using the last argument as keyword parameters is deprecated; maybe ** should be
added to the call
/home/kash/.rvm/gems/ruby-2.7.0/gems/activerecord-
6.0.2.2/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method
add_modifier' is defined here /home/kash/.rvm/gems/ruby-2.7.0/gems/milia- 0.3.30/app/controllers/registrations_controller.rb:5:in class:RegistrationsController':
undefined method skip_before_filter' for Milia::RegistrationsController:Class Did you mean? skip_before_action (NoMethodError) from /home/kash/.rvm/gems/ruby-2.7.0/gems/milia- 0.3.30/app/controllers/registrations_controller.rb:3:in module:Milia'
from /home/kash/.rvm/gems/ruby-2.7.0/gems/milia-

@yshmarov
Copy link

yshmarov commented May 16, 2020

This works: Gemfile:
gem 'milia', '~>1.3', :git => 'https://github.com/yshmarov/milia.git'

gem milia POST MORTEM

So, the gem has not been maintained by the "owner" for 3 years now. Pull requests are even reviewed.

Face it, Milia was never a good multi-tenanting gem. On the top of my head - too much magic in the installation, and anyways sessions is not the best way to track current_tenant. It can get "stuck" when logging in/out and switching tenants.

Unfortunately I fell for it some years ago and wasted dozens of hours as a consequence. I should have gone with something else.

Why milia? 95% of the popularity of this gem came from this amateur-level course on udemy

what now?

  1. A few users have forked the gem and customized it for their personal needs. You can check out the forks and find something interesting

  2. We don't need 5 gems that do the same thing. Better to put all effort into one gem that does the job well (think devise).

In case of multitenancy, we have 2 good options:
https://github.com/ErwinM/acts_as_tenant - all tenants in one database
https://github.com/influitive/apartment - separate database for each tenant

summary: don't rely on low-maintained third-party code, like gem milia

Not to underestimate the initial creator of the gem @dsaronin who was a legend.

Originally posted by @yshmarov in #88 (comment)

@jekuno
Copy link
Owner

jekuno commented May 17, 2020

@yshmarov Thanks for bringing the mainitenance topic back to my attention. Please see #90 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants