Adds multisite support to paperclipped, showing assets only for the current site if the user is not an admin
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
db/migrate
lib/tasks
spec
.gitignore
README
Rakefile
paperclipped_multi_site_extension.rb

README

= paperclipped_multi_site

This extension scopes assets to sites. Our fork of multi-site is needed, and does most of the work in the model (by putting a scope around find, essentially), so there are no controller modifications required and we can shrink this to a couple of lines.

You could probably get rid of this extension altogether by adding this to Asset:

  is_site_scoped if defined? Site && Radiant::Config['assets.scoped?']

But the conditionality does make your tests a bit more tangled.

Some basic tests are included to make sure that Asset loads and is properly scoped.