![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
= Account Scopper
Account Scopper aims to make conversion from a single account to multi-accounts application as easy as possible.
Simply set your current_account before each request and the scoping will be done on it's own.
== Install
If new to gemcutter first run
sudo gem install gemcutter sudo gemcutter tumble
Then run
sudo gem install account_scopper
If using rails, in your config/environment.rb
config.gem 'account_scopper'
== Usage
To convert your application, you will need to make few changes :
eg:
class Account < ActiveRecord::Base cattr_accessor :current_account
has_many :users
end
class User < ActiveRecord::Base
belongs_to :account
end
class ApplicationController < ActionController::Base before_filter :set_current_account # ...
private
# Don't forget that @current_account should be properly setup to be an Account object
# for this purpose you can use the plugin AccountLocation from David Heinemeier Hansson
def set_current_account
Account.current_account = @current_account
end
end
== What it does
The plugin overwrite few methods from ActiveRecord::Base
To have a better understanding of what it does, the best way is still to look at the code itself and the tests.
== Helpers
As account_scopper scopes all database requests, validates_uniqueness_of
will also scope to the current account.
In some cases, you may like to make sure that somethings remain unique to your whole system.
(eg: the user login or email if logging in from a common page for all accounts)
For this purpose, you can use validates_global_uniqueness_of
. This validations will make sure your attribute is unique over all accounts.
== Warning
If using manually generated database requests like find_by_sql, ... you'll have to do your own scoping
== Note on Patches/Pull Requests
== Copyright
Copyright (c) 2009 Sebastien Grosjean. See LICENSE for details.
FAQs
Unknown package
We found that account_scopper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.