0
0
Fork 0

Admin reports with accounts (#2092)

* Add a ReportFilter class

* Add reports and targeted_reports relationships to Account

* Use ReportFilter from admin/reports controller

* Link to admin/reports filtered views from admin account show view

* Add indexes to reports.account_id and reports.target_account_id
This commit is contained in:
Matt Jankowski 2017-04-18 13:36:18 -04:00 committed by Eugen
parent f23281e31e
commit 66d8f99a30
9 changed files with 92 additions and 5 deletions

View file

@ -0,0 +1,6 @@
class AddIndexesToReportsForAccounts < ActiveRecord::Migration[5.0]
def change
add_index :reports, :account_id
add_index :reports, :target_account_id
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170414132105) do
ActiveRecord::Schema.define(version: 20170418160728) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -215,6 +215,8 @@ ActiveRecord::Schema.define(version: 20170414132105) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "action_taken_by_account_id"
t.index ["account_id"], name: "index_reports_on_account_id", using: :btree
t.index ["target_account_id"], name: "index_reports_on_target_account_id", using: :btree
end
create_table "settings", force: :cascade do |t|