-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded to Rails 3.1. as_json serialization changed to where only su…
…bresources use to_xml/serializable_hash so there's a slight security problem where as_json objects return protected attributres. Majorly refactored to some more Rails 3 type conventions and got rid of custom mass assignment authorizer and now using ActiveModel::MassAssignmentSecurity.
- Loading branch information
Ethan Waldo
committed
Sep 11, 2011
1 parent
677e401
commit 62798c8
Showing
40 changed files
with
319 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rvm_gemset_create_on_use_flag=1 | ||
rvm ruby-1.9.2@raor | ||
echo "Switching to" `rvm current` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
class ApplicationController < ActionController::Base | ||
include BrowserDetect | ||
before_filter :authenticate_user! | ||
protect_from_forgery | ||
rescue_from CanCan::AccessDenied do |exception| | ||
redirect_to root_url, :alert => exception.message | ||
end | ||
|
||
protected | ||
def as_what? | ||
klass = self.class.name.sub("Controller", "").underscore.split('/').last.singularize.camelize.constantize | ||
self.can?(:manage, klass) ? :admin : :default | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.