This commit is contained in:
Nicolas Bally 2021-06-11 15:28:32 +02:00
parent 6919355548
commit 5e9a5673ec
3 changed files with 17 additions and 1 deletions

View File

@ -92,6 +92,16 @@ class Societe < ApplicationRecord
end end
def self.update_card_names
Societe.all.each do |s|
VContact.where(:codeproprietaire => s.socmanaginn).update_all(:cc_centre => s.nom)
end
end

View File

@ -0,0 +1,5 @@
class AddCcCentreToVContacts < ActiveRecord::Migration[6.0]
def change
add_column :v_contacts, :cc_centre, :string
end
end

View File

@ -10,7 +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.
ActiveRecord::Schema.define(version: 2019_11_03_133826) do ActiveRecord::Schema.define(version: 2020_10_30_113001) do
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "name" t.string "name"
@ -2133,6 +2133,7 @@ ActiveRecord::Schema.define(version: 2019_11_03_133826) do
t.decimal "ac_rate", precision: 14, scale: 2 t.decimal "ac_rate", precision: 14, scale: 2
t.boolean "enabled", default: false t.boolean "enabled", default: false
t.integer "nbr_mvt" t.integer "nbr_mvt"
t.string "cc_centre"
end end
create_table "video_contents", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| create_table "video_contents", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|