Invoice filtering in registrar

This commit is contained in:
Martin Lensment 2015-04-28 12:14:20 +03:00
parent 1f2f483e34
commit 23098add74
13 changed files with 83 additions and 7 deletions

View file

@ -0,0 +1,6 @@
class AddSumCacheToInvoice < ActiveRecord::Migration
def change
add_column :invoices, :sum_cache, :decimal
Invoice.all.each(&:save)
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: 20150427073517) do
ActiveRecord::Schema.define(version: 20150428075052) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -368,6 +368,7 @@ ActiveRecord::Schema.define(version: 20150427073517) do
t.string "updator_str"
t.integer "number"
t.datetime "cancelled_at"
t.decimal "sum_cache"
end
add_index "invoices", ["buyer_id"], name: "index_invoices_on_buyer_id", using: :btree