Commit 3965524711641db613a4baa3885cef8ccf3d49e5
1 parent
9ddf3eb1
Exists in
master
and in
28 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,9 +12,7 @@ class ApplicationController < ActionController::Base | ||
12 | # Load the owner | 12 | # Load the owner |
13 | def load_owner | 13 | def load_owner |
14 | # TODO: this should not be hardcoded | 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 | end | 16 | end |
19 | 17 | ||
20 | protected | 18 | protected |
@@ -30,10 +28,6 @@ class ApplicationController < ActionController::Base | @@ -30,10 +28,6 @@ class ApplicationController < ActionController::Base | ||
30 | end | 28 | end |
31 | end | 29 | end |
32 | 30 | ||
33 | - def flexible_template_onwer | ||
34 | - @virtual_community_admin || @profile | ||
35 | - end | ||
36 | - | ||
37 | def self.acts_as_virtual_community_admin_controller | 31 | def self.acts_as_virtual_community_admin_controller |
38 | before_filter :load_admin_controller | 32 | before_filter :load_admin_controller |
39 | end | 33 | end |
app/controllers/enterprise_controller.rb
1 | # Manage enterprises by providing an interface to register, activate and manage them | 1 | # Manage enterprises by providing an interface to register, activate and manage them |
2 | class EnterpriseController < ApplicationController | 2 | class EnterpriseController < ApplicationController |
3 | 3 | ||
4 | + def index | ||
5 | + @my_enterprises = current_user.enterprises | ||
6 | + end | ||
7 | + | ||
4 | def register | 8 | def register |
5 | unless logged_in? | 9 | unless logged_in? |
6 | redirect_to :controller => 'account' | 10 | redirect_to :controller => 'account' |
db/migrate/007_create_enterprises.rb
@@ -11,6 +11,7 @@ class CreateEnterprises < ActiveRecord::Migration | @@ -11,6 +11,7 @@ class CreateEnterprises < ActiveRecord::Migration | ||
11 | t.column :economic_activity, :string | 11 | t.column :economic_activity, :string |
12 | t.column :management_information, :string | 12 | t.column :management_information, :string |
13 | t.column :active, :boolean, :default => "false" | 13 | t.column :active, :boolean, :default => "false" |
14 | + t.column :manager_id, :integer | ||
14 | end | 15 | end |
15 | end | 16 | end |
16 | 17 |