Permalink
Browse files

Merge branch 'pricing_section_dimensions' into pricing_door_line_section

  • Loading branch information...
2 parents 6503a48 + 18861de commit 6576170aaf339e770ca539ba9f4c51a49d5e7068 @josyan committed Feb 29, 2012
@@ -17,6 +17,9 @@ def price
# door glass
p += door_glass.price if door_glass
+ # section dimension
+ p += door_section_dimension.price
+
p
end
@@ -1,3 +1,5 @@
class DoorSectionDimension < ActiveRecord::Base
+ include Priceable
+
belongs_to :door_section
end
@@ -5,4 +5,8 @@
<td align="right"><%= trn_geth('LABEL_SIZE') %><%= trn_geth('LABEL_SEMICOLON') %></td>
<td><%= text_field 'door_section_dimension', 'value', :size => 30 %></td>
</tr>
+ <tr valign="top">
+ <td align="right"><%= trn_geth('LABEL_PRICE') %><%= trn_geth('LABEL_SEMICOLON') %></td>
+ <td><%= text_field 'door_section_dimension', 'price', :size => 30 %></td>
+ </tr>
</table>
@@ -0,0 +1,9 @@
+class AddPriceToDoorSectionDimensions < ActiveRecord::Migration
+ def self.up
+ add_column :door_section_dimensions, :price, :float, :default => 0.0
+ end
+
+ def self.down
+ remove_column :door_section_dimensions, :price
+ end
+end
View
@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120229021033) do
+ActiveRecord::Schema.define(:version => 20120229023057) do
create_table "companies", :force => true do |t|
t.string "name", :limit => 100, :default => "", :null => false
@@ -175,6 +175,7 @@
t.float "value"
t.datetime "created_at"
t.datetime "updated_at"
+ t.float "price", :default => 0.0
end
create_table "door_sections", :force => true do |t|

0 comments on commit 6576170

Please sign in to comment.