diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 72a148f..b4dc488 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -1,4 +1,3 @@ #A enterprise is a kind of profile. According to the system concept, only enterprises can offer priducts/services class Enterprise < Profile - end diff --git a/app/models/user.rb b/app/models/user.rb index 4053cc8..b3393f1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,7 +5,7 @@ require 'digest/sha1' class User < ActiveRecord::Base after_create do |user| - Profile.create!(:identifier => user.login, :profile_owner_id => user.id, :profile_owner_type => 'User') + Person.create!(:identifier => user.login, :profile_owner_id => user.id, :profile_owner_type => 'User') end has_one :personal_profile, :class_name => 'Profile', :as => :profile_owner diff --git a/db/migrate/007_create_affiliations.rb b/db/migrate/007_create_affiliations.rb new file mode 100644 index 0000000..4bcfd7c --- /dev/null +++ b/db/migrate/007_create_affiliations.rb @@ -0,0 +1,12 @@ +class CreateAffiliations < ActiveRecord::Migration + def self.up + create_table :affiliations do |t| + t.column :user_id, :integer + t.column :profile_id, :integer + end + end + + def self.down + drop_table :affiliations + end +end diff --git a/db/migrate/008_create_affiliations.rb b/db/migrate/008_create_affiliations.rb deleted file mode 100644 index 4bcfd7c..0000000 --- a/db/migrate/008_create_affiliations.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateAffiliations < ActiveRecord::Migration - def self.up - create_table :affiliations do |t| - t.column :user_id, :integer - t.column :profile_id, :integer - end - end - - def self.down - drop_table :affiliations - end -end diff --git a/db/migrate/008_create_people.rb b/db/migrate/008_create_people.rb new file mode 100644 index 0000000..6afc9bb --- /dev/null +++ b/db/migrate/008_create_people.rb @@ -0,0 +1,10 @@ +class CreatePeople < ActiveRecord::Migration + def self.up + create_table :people do |t| + end + end + + def self.down + drop_table :people + end +end diff --git a/test/fixtures/enterprises.yml b/test/fixtures/enterprises.yml index b49c4eb..4e336b7 100644 --- a/test/fixtures/enterprises.yml +++ b/test/fixtures/enterprises.yml @@ -1,5 +1,8 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html one: id: 1 + name: 'Enterprise 1' + manager_id: 1 + active: false two: id: 2 -- libgit2 0.21.2