Binding interface for bank statements

This commit is contained in:
Martin Lensment 2015-04-15 11:32:51 +03:00
parent 2dfa65645b
commit 851e5368eb
15 changed files with 113 additions and 26 deletions

View file

@ -0,0 +1,10 @@
class FixAccountBalancesToDecimal < ActiveRecord::Migration
def change
Account.all.each do |x|
x.balance = 0.0 unless x.balance
x.save
end
change_column :accounts, :balance, :decimal, null: false, default: 0
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150414124630) do
ActiveRecord::Schema.define(version: 20150415075408) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -29,7 +29,7 @@ ActiveRecord::Schema.define(version: 20150414124630) do
create_table "accounts", force: :cascade do |t|
t.integer "registrar_id"
t.string "account_type"
t.decimal "balance"
t.decimal "balance", default: 0.0, null: false
t.datetime "created_at"
t.datetime "updated_at"
end