THIS PATCH REQUIRES A MIGRATION
Adds a column to products, named logo_name, which is the filename for
the product's logo file.
The migration also injects a new configuration property to indicate the
path for product logos. The default value for this property is
"/images/logos/products" and that directory has been added to the
project tree.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
db/migrate/034_add_logo_to_products.rb | 30 ++++++++++++++++++++++++++++++
doc/ChangeLog | 1 +
test/fixtures/config_properties.yml | 4 ++++
3 files changed, 35 insertions(+), 0 deletions(-)
create mode 100644 db/migrate/034_add_logo_to_products.rb
diff --git a/db/migrate/034_add_logo_to_products.rb
b/db/migrate/034_add_logo_to_products.rb
new file mode 100644
index 0000000..3940b68
--- /dev/null
+++ b/db/migrate/034_add_logo_to_products.rb
@@ -0,0 +1,30 @@
+# 034_add_log_to_products.rb
+# Copyright (C) 2009, Darryl L. Pierce <mcpierce(a)gmail.com>
+#
+# 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 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 General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <
http://www.gnu.org/licenses/>.
+#
+
+class AddLogoToProducts < ActiveRecord::Migration
+ def self.up
+ add_column :products, :logo_name, :string, :limit => 255, :null => true,
:default => nil
+
+ # set the default path
+ ConfigProperty.store("image.product_logo_path",
"/images/products")
+ end
+
+ def self.down
+ remove_column :products, :logo_name
+ ConfigProperty.remove("image.product_logo_path")
+ end
+end
diff --git a/doc/ChangeLog b/doc/ChangeLog
index e75f12d..7afeb8b 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -14,6 +14,7 @@ Change Log (0.2.0):
* #111 - User story descriptions can have wiki markup.
* #117 - Projects have logos.
* #118 - Projects without a logo show the default logo.
+ * #120 - Products have logos.
* #125 - Added a system title to all pages.
* #131 - Admins can filter out unapproved projects.
* #132 - Team leads can start sprints.
diff --git a/test/fixtures/config_properties.yml b/test/fixtures/config_properties.yml
index 4a48e82..274b58c 100644
--- a/test/fixtures/config_properties.yml
+++ b/test/fixtures/config_properties.yml
@@ -5,3 +5,7 @@ system_name:
default_project_logo:
name: image.default_project_logo
value: project_logo
+
+product_logo_path:
+ name: image.product_logo_path
+ value: /images/logos/products
--
1.6.0.6