Skip to content

Rails plugin that scopes all finds, updates and creates to a specific column and value (country_id, company_id etc.)

Notifications You must be signed in to change notification settings

carr/scope_everything

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Scope everything

Rails plugin that scopes all finds, updates and creates to a specific column and value (country_id, company_id etc.)

Usage

In your environment.rb set this:

ActiveRecord::ScopeEverything.field = 'company_id'

In some before filter (probably after you have authenticated your user)

Thread.current['company_id'] = current_user.company.id

Bugs

Feel free to report bugs, tomislav-?-infinum-.-hr.die_spam

About

Rails plugin that scopes all finds, updates and creates to a specific column and value (country_id, company_id etc.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages