mirror of
https://github.com/internetee/registry.git
synced 2025-05-30 09:30:03 +02:00
Binding interface for bank statements
This commit is contained in:
parent
2dfa65645b
commit
851e5368eb
15 changed files with 113 additions and 26 deletions
10
db/migrate/20150415075408_fix_account_balances_to_decimal.rb
Normal file
10
db/migrate/20150415075408_fix_account_balances_to_decimal.rb
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue