7 changed files with 46 additions and 2 deletions
@ -0,0 +1,14 @@ |
|||||||
|
class Form::Sales::Pages::MortgageAmount < ::Form::Page |
||||||
|
def initialize(id, hsh, subsection) |
||||||
|
super |
||||||
|
@header = "Mortgage Amount" |
||||||
|
@description = "" |
||||||
|
@subsection = subsection |
||||||
|
end |
||||||
|
|
||||||
|
def questions |
||||||
|
@questions ||= [ |
||||||
|
Form::Sales::Questions::MortgageAmount.new(nil, nil, self), |
||||||
|
] |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
class Form::Sales::Questions::MortgageAmount < ::Form::Question |
||||||
|
def initialize(id, hsh, page) |
||||||
|
super |
||||||
|
@id = "mortgage" |
||||||
|
@check_answer_label = "Mortgage amount" |
||||||
|
@header = "What is the mortgage amount?" |
||||||
|
@type = "numeric" |
||||||
|
@page = page |
||||||
|
@min = 0 |
||||||
|
@width = 5 |
||||||
|
@prefix = "£" |
||||||
|
@hint_text = "" |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
class ChangeMortgageToFloat < ActiveRecord::Migration[7.0] |
||||||
|
def self.up |
||||||
|
change_table :sales_logs do |t| |
||||||
|
t.change :mortgage, :decimal, precision: 10, scale: 2 |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
def self.down |
||||||
|
change_table :sales_logs do |t| |
||||||
|
t.change :mortgage, :integer |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
Loading…
Reference in new issue