Skip to content

Commit

Permalink
Annotated models for database schema #19
Browse files Browse the repository at this point in the history
[#57 state:open]
  • Loading branch information
Mike Dvorkin committed Jul 20, 2009
1 parent 2703665 commit 346c00f
Show file tree
Hide file tree
Showing 46 changed files with 328 additions and 250 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ It does not matter how slowly you go as long as you do not stop.
First they ignore you, then they laugh at you, then they fight you,
then you win. –- Mahatma Gandhi

Mon, Jul 20, 2009
---------------------------------------------------------------------
- Happy birthday, Lana!
- Annotated models for schema version #19.

Sun, Jul 19, 2009
---------------------------------------------------------------------
- Completed upgrade to Authlogic 2.1.2
- Removed support for OpenID authentication

Sat, Jul 18, 2009
---------------------------------------------------------------------
- Upgrading to Authlogic 2.1.2

Wed, Jul 15, 2009
---------------------------------------------------------------------
- Moved avatars in separate directories based on who the avatar belongs to.
Expand Down
34 changes: 17 additions & 17 deletions app/models/account.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
# Schema version: 19
#
# Table name: accounts
#
Expand All @@ -36,6 +20,22 @@
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
class Account < ActiveRecord::Base
belongs_to :user
has_many :account_contacts, :dependent => :destroy
Expand Down
26 changes: 13 additions & 13 deletions app/models/account_contact.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# == Schema Information
# Schema version: 19
#
# Table name: account_contacts
#
# id :integer(4) not null, primary key
# account_id :integer(4)
# contact_id :integer(4)
# deleted_at :datetime
# created_at :datetime
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
Expand All @@ -14,19 +27,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
#
# Table name: account_contacts
#
# id :integer(4) not null, primary key
# account_id :integer(4)
# contact_id :integer(4)
# deleted_at :datetime
# created_at :datetime
# updated_at :datetime
#

class AccountContact < ActiveRecord::Base
belongs_to :account
belongs_to :contact
Expand Down
26 changes: 13 additions & 13 deletions app/models/account_opportunity.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# == Schema Information
# Schema version: 19
#
# Table name: account_opportunities
#
# id :integer(4) not null, primary key
# account_id :integer(4)
# opportunity_id :integer(4)
# deleted_at :datetime
# created_at :datetime
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
Expand All @@ -14,19 +27,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
#
# Table name: account_opportunities
#
# id :integer(4) not null, primary key
# account_id :integer(4)
# opportunity_id :integer(4)
# deleted_at :datetime
# created_at :datetime
# updated_at :datetime
#

class AccountOpportunity < ActiveRecord::Base
belongs_to :account
belongs_to :opportunity
Expand Down
32 changes: 16 additions & 16 deletions app/models/activity.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# == Schema Information
# Schema version: 19
#
# Table name: activities
#
# id :integer(4) not null, primary key
# user_id :integer(4)
# subject_id :integer(4)
# subject_type :string(255)
# action :string(32) default("created")
# info :string(255) default("")
# private :boolean(1)
# created_at :datetime
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
Expand All @@ -14,22 +30,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
#
# Table name: activities
#
# id :integer(4) not null, primary key
# user_id :integer(4)
# subject_id :integer(4)
# subject_type :string(255)
# action :string(32) default("created")
# info :string(255) default("")
# private :boolean(1)
# created_at :datetime
# updated_at :datetime
#

class Activity < ActiveRecord::Base

belongs_to :user
Expand Down
16 changes: 16 additions & 0 deletions app/models/avatar.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# == Schema Information
# Schema version: 19
#
# Table name: avatars
#
# id :integer(4) not null, primary key
# user_id :integer(4)
# entity_id :integer(4)
# entity_type :string(255)
# image_file_size :integer(4)
# image_file_name :string(255)
# image_content_type :string(255)
# created_at :datetime
# updated_at :datetime
#

class Avatar < ActiveRecord::Base
STYLES = { :large => "75x75#", :medium => "50x50#", :small => "25x25#", :thumb => "16x16#" }.freeze

Expand Down
34 changes: 17 additions & 17 deletions app/models/campaign.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
# Schema version: 19
#
# Table name: campaigns
#
Expand All @@ -41,6 +25,22 @@
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
class Campaign < ActiveRecord::Base
belongs_to :user
has_many :tasks, :as => :asset, :dependent => :destroy, :order => 'created_at DESC'
Expand Down
32 changes: 16 additions & 16 deletions app/models/comment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# == Schema Information
# Schema version: 19
#
# Table name: comments
#
# id :integer(4) not null, primary key
# user_id :integer(4)
# commentable_id :integer(4)
# commentable_type :string(255)
# private :boolean(1)
# title :string(255) default("")
# comment :text
# created_at :datetime
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
Expand All @@ -14,22 +30,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
#
# Table name: comments
#
# id :integer(4) not null, primary key
# user_id :integer(4)
# commentable_id :integer(4)
# commentable_type :string(255)
# private :boolean(1)
# title :string(255) default("")
# comment :text
# created_at :datetime
# updated_at :datetime
#

class Comment < ActiveRecord::Base
belongs_to :user
belongs_to :commentable, :polymorphic => true
Expand Down
34 changes: 17 additions & 17 deletions app/models/contact.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
# Schema version: 19
#
# Table name: contacts
#
Expand Down Expand Up @@ -48,6 +32,22 @@
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
class Contact < ActiveRecord::Base
belongs_to :user
belongs_to :lead
Expand Down
28 changes: 14 additions & 14 deletions app/models/contact_opportunity.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# == Schema Information
# Schema version: 19
#
# Table name: contact_opportunities
#
# id :integer(4) not null, primary key
# contact_id :integer(4)
# opportunity_id :integer(4)
# role :string(32)
# deleted_at :datetime
# created_at :datetime
# updated_at :datetime
#

# Fat Free CRM
# Copyright (C) 2008-2009 by Michael Dvorkin
#
Expand All @@ -14,20 +28,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# == Schema Information
# Schema version: 17
#
# Table name: contact_opportunities
#
# id :integer(4) not null, primary key
# contact_id :integer(4)
# opportunity_id :integer(4)
# role :string(32)
# deleted_at :datetime
# created_at :datetime
# updated_at :datetime
#

class ContactOpportunity < ActiveRecord::Base
belongs_to :contact
belongs_to :opportunity
Expand Down
Loading

0 comments on commit 346c00f

Please sign in to comment.