Commit 3965524711641db613a4baa3885cef8ccf3d49e5
1 parent
9ddf3eb1
Exists in
staging
and in
42 other branches
ActionItem6: affiliation added
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@184 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
7 changed files
with
37 additions
and
7 deletions
Show diff stats
app/controllers/application.rb
| ... | ... | @@ -12,9 +12,7 @@ class ApplicationController < ActionController::Base |
| 12 | 12 | # Load the owner |
| 13 | 13 | def load_owner |
| 14 | 14 | # TODO: this should not be hardcoded |
| 15 | - if Profile.exists?(1) | |
| 16 | - @owner = Profile.find(1) | |
| 17 | - end | |
| 15 | + @owner = Profile.find(1) if Profile.exists?(1) | |
| 18 | 16 | end |
| 19 | 17 | |
| 20 | 18 | protected |
| ... | ... | @@ -30,10 +28,6 @@ class ApplicationController < ActionController::Base |
| 30 | 28 | end |
| 31 | 29 | end |
| 32 | 30 | |
| 33 | - def flexible_template_onwer | |
| 34 | - @virtual_community_admin || @profile | |
| 35 | - end | |
| 36 | - | |
| 37 | 31 | def self.acts_as_virtual_community_admin_controller |
| 38 | 32 | before_filter :load_admin_controller |
| 39 | 33 | end | ... | ... |
app/controllers/enterprise_controller.rb
| 1 | 1 | # Manage enterprises by providing an interface to register, activate and manage them |
| 2 | 2 | class EnterpriseController < ApplicationController |
| 3 | 3 | |
| 4 | + def index | |
| 5 | + @my_enterprises = current_user.enterprises | |
| 6 | + end | |
| 7 | + | |
| 4 | 8 | def register |
| 5 | 9 | unless logged_in? |
| 6 | 10 | redirect_to :controller => 'account' | ... | ... |
db/migrate/007_create_enterprises.rb