public
Description: Adds multisite support to paperclipped, showing assets only for the current site if the user is not an admin
Homepage:
Clone URL: git://github.com/kbingman/radiant-paperclipped_multisite-extension.git
spanner (author)
Sat Mar 14 07:15:11 -0700 2009
kbingman (committer)
Wed Apr 22 00:01:33 -0700 2009
name age message
file .gitignore Mon Aug 11 00:30:20 -0700 2008 first setup [kbingman]
file README Wed Apr 22 00:01:33 -0700 2009 making readme useful Signed-off-by: Keith BIng... [spanner]
file Rakefile Mon Aug 11 00:30:20 -0700 2008 first setup [kbingman]
directory db/ Mon Aug 11 00:30:20 -0700 2008 first setup [kbingman]
directory lib/ Sat Mar 14 05:39:53 -0700 2009 simplified [spanner]
file paperclipped_multi_site_extension.rb Wed Apr 22 00:01:29 -0700 2009 simplified Signed-off-by: Keith BIngman <keith... [spanner]
directory spec/ Sat Mar 14 07:06:10 -0700 2009 a few site-scope tests [spanner]
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.