pull/6827/head
parent
9968db24b3
commit
fe732cf767
@ -0,0 +1,43 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# |
||||
# Copyright (C) 2012-2013 the OpenProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
class Journal::CostObjectJournal < ActiveRecord::Base |
||||
|
||||
# include ActiveModel::ForbiddenAttributesProtection |
||||
|
||||
self.table_name = "cost_object_journals" |
||||
|
||||
belongs_to :journal |
||||
|
||||
# attr_accessible :project_id, :author_id, :subject, :description, :fixed_date, :created_on |
||||
|
||||
# acts_as_journalized |
||||
|
||||
# acts_as_journalized :event_type => 'cost-object', |
||||
# :event_title => Proc.new {|o| "#{l(:label_cost_object)} ##{o.journaled.id}: #{o.subject}"}, |
||||
# :event_url => Proc.new {|o| {:controller => 'cost_objects', :action => 'show', :id => o.journaled.id}}, |
||||
# :activity_type => superclass.plural_name, |
||||
# :activity_find_options => {:include => [:project, :author]}, |
||||
# :activity_timestamp => "#{table_name}.updated_on", |
||||
# :activity_author_key => :author_id, |
||||
# :activity_permission => :view_cost_objects |
||||
|
||||
@@journaled_attributes = [:project_id, |
||||
:author_id, |
||||
:subject, |
||||
:description, |
||||
:fixed_date] |
||||
|
||||
def journaled_attributes |
||||
attributes.symbolize_keys.select{|k,_| @@journaled_attributes.include? k} |
||||
end |
||||
end |
@ -0,0 +1,34 @@ |
||||
|
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# |
||||
# Copyright (C) 2012-2013 the OpenProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
class Journal::VariableCostObjectJournal < Journal::CostObjectJournal |
||||
|
||||
# include ActiveModel::ForbiddenAttributesProtection |
||||
|
||||
# self.table_name = "cost_object_journals" |
||||
|
||||
# belongs_to :journal |
||||
|
||||
# attr_accessible :type, :id, :project_id, :author_id, :subject, :description, :fixed_date, :created_on |
||||
|
||||
# @@journaled_attributes = [:project_id, |
||||
# :author_id, |
||||
# :subject, |
||||
# :description, |
||||
# :type, |
||||
# :fixed_date] |
||||
|
||||
# def journaled_attributes |
||||
# attributes.symbolize_keys.select{|k,_| @@journaled_attributes.include? k} |
||||
# end |
||||
end |
@ -0,0 +1,40 @@ |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# 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 General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
class AddCostObjectJournals < ActiveRecord::Migration |
||||
def change |
||||
create_table :cost_object_journals do |t| |
||||
t.integer :journal_id, :null => false |
||||
t.integer :project_id, :null => false |
||||
t.integer :author_id, :null => false |
||||
t.string :subject, :null => false |
||||
t.text :description, :null => false |
||||
t.date :fixed_date, :null => false |
||||
t.datetime :created_on |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,5 @@ |
||||
class AddCostObjectIdToWorkPackageJournals < ActiveRecord::Migration |
||||
def change |
||||
add_column :work_package_journals, :cost_object_id, :integer, null: true |
||||
end |
||||
end |
Loading…
Reference in new issue