Browse Source

fix merge and lint

pull/726/head
Ted Booton 3 years ago
parent
commit
380d0fa6a2
  1. 4
      app/models/organisation.rb
  2. 14
      db/schema.rb

4
app/models/organisation.rb

@ -5,8 +5,8 @@ class Organisation < ApplicationRecord
has_many :data_protection_confirmations has_many :data_protection_confirmations
has_many :organisation_rent_periods has_many :organisation_rent_periods
has_many :owned_schemes, class_name: "Scheme", foreign_key: "owning_organisation_id", dependent: :destroy has_many :owned_schemes, class_name: "Scheme", foreign_key: "owning_organisation_id"
has_many :managed_schemes, class_name: "Scheme", foreign_key: "managing_organisation_id", dependent: :destroy has_many :managed_schemes, class_name: "Scheme", foreign_key: "managing_organisation_id"
scope :search_by_name, ->(name) { where("name ILIKE ?", "%#{name}%") } scope :search_by_name, ->(name) { where("name ILIKE ?", "%#{name}%") }
scope :search_by, ->(param) { search_by_name(param) } scope :search_by, ->(param) { search_by_name(param) }

14
db/schema.rb

@ -10,11 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
<<<<<<< HEAD
ActiveRecord::Schema[7.0].define(version: 2022_07_07_133909) do
=======
ActiveRecord::Schema[7.0].define(version: 2022_07_06_104313) do ActiveRecord::Schema[7.0].define(version: 2022_07_06_104313) do
>>>>>>> 34b57577d7a407bdbb6d5b17a0883c984d66ed78
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -204,11 +200,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_06_104313) do
t.integer "vacdays" t.integer "vacdays"
t.bigint "scheme_id" t.bigint "scheme_id"
t.bigint "location_id" t.bigint "location_id"
<<<<<<< HEAD
t.bigint "organisations_id"
=======
t.integer "unittype_sh" t.integer "unittype_sh"
>>>>>>> 34b57577d7a407bdbb6d5b17a0883c984d66ed78
t.index ["created_by_id"], name: "index_case_logs_on_created_by_id" t.index ["created_by_id"], name: "index_case_logs_on_created_by_id"
t.index ["location_id"], name: "index_case_logs_on_location_id" t.index ["location_id"], name: "index_case_logs_on_location_id"
t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id" t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id"
@ -386,12 +378,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_06_104313) do
add_foreign_key "case_logs", "organisations", column: "organisations_id" add_foreign_key "case_logs", "organisations", column: "organisations_id"
add_foreign_key "case_logs", "schemes" add_foreign_key "case_logs", "schemes"
add_foreign_key "locations", "schemes" add_foreign_key "locations", "schemes"
<<<<<<< HEAD
add_foreign_key "schemes", "organisations"
add_foreign_key "schemes", "organisations", column: "stock_owning_organisation_id"
add_foreign_key "users", "organisations", column: "organisations_id"
=======
add_foreign_key "schemes", "organisations", column: "managing_organisation_id" add_foreign_key "schemes", "organisations", column: "managing_organisation_id"
add_foreign_key "schemes", "organisations", column: "owning_organisation_id" add_foreign_key "schemes", "organisations", column: "owning_organisation_id"
>>>>>>> 34b57577d7a407bdbb6d5b17a0883c984d66ed78
end end

Loading…
Cancel
Save