diff --git a/app/models/university/organization.rb b/app/models/university/organization.rb index b53bb6e69e93b73cdd0cfdef3d38a0dcf7bd051b..f4de3cad85950389462247e0008c08badc0bb63c 100644 --- a/app/models/university/organization.rb +++ b/app/models/university/organization.rb @@ -12,8 +12,9 @@ # kind :integer default("company") # long_name :string # name :string +# nic :string # phone :string -# sirene :string +# siren :string # slug :string # text :text # url :string diff --git a/app/models/university/organization/import.rb b/app/models/university/organization/import.rb index b7115fc6440660b061f5c1a7c551dfad71d9ccd3..46f51178f73850836e626576f74352c27404124d 100644 --- a/app/models/university/organization/import.rb +++ b/app/models/university/organization/import.rb @@ -45,7 +45,8 @@ class University::Organization::Import < ApplicationRecord [ :long_name, :kind, - :sirene, + :siren, + :nic, :description, :address, :zipcode, diff --git a/app/views/admin/university/organization/imports/new.html.erb b/app/views/admin/university/organization/imports/new.html.erb index 714bdfc7a59596dc1bfe3f15714f3a625506341b..9199ac8abd1265c5b71a432be7c74a86107e12d7 100644 --- a/app/views/admin/university/organization/imports/new.html.erb +++ b/app/views/admin/university/organization/imports/new.html.erb @@ -34,8 +34,12 @@ <td>company</td> </tr> <tr> - <th>sirene</th> - <td>00000000</td> + <th>siren</th> + <td>433891850</td> + </tr> + <tr> + <th>nic</th> + <td>00052</td> </tr> <tr> <th>description</th> diff --git a/app/views/admin/university/organizations/index.html.erb b/app/views/admin/university/organizations/index.html.erb index 1fd6f4dbfeb176f96400859c77d82cdef55581ad..b538dd5cd15b0eb73a89a6afdaddfea780d957e2 100644 --- a/app/views/admin/university/organizations/index.html.erb +++ b/app/views/admin/university/organizations/index.html.erb @@ -5,7 +5,7 @@ <% content_for :action_bar_left do %> <%= link_to t('import'), - admin_university_organization_imports_path, + new_admin_university_organization_import_path, class: button_classes if can? :manage, University::Organization::Import %> <% end %> diff --git a/db/migrate/20220413071151_fix_siret.rb b/db/migrate/20220413071151_fix_siret.rb new file mode 100644 index 0000000000000000000000000000000000000000..77954884264e1e13d8a725f5c4e30fe15a5ed30e --- /dev/null +++ b/db/migrate/20220413071151_fix_siret.rb @@ -0,0 +1,6 @@ +class FixSiret < ActiveRecord::Migration[6.1] + def change + rename_column :university_organizations, :sirene, :siren + add_column :university_organizations, :nic, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index e55c58753ea3646da60b7d978954e2826f6bc5b8..319a9edd7885e533b6d3c52d2f871c378708ba44 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_04_08_091854) do +ActiveRecord::Schema.define(version: 2022_04_13_071151) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -642,12 +642,13 @@ ActiveRecord::Schema.define(version: 2022_04_08_091854) do t.string "phone" t.string "email" t.boolean "active", default: true - t.string "sirene" + t.string "siren" t.integer "kind", default: 10 t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.string "slug" t.text "text" + t.string "nic" t.index ["university_id"], name: "index_university_organizations_on_university_id" end diff --git a/test/fixtures/university/organizations.yml b/test/fixtures/university/organizations.yml index a6627badce8edfd4c126e36dd58d5e598f49a958..e20b37fe71700bceebefb89c3b6e4f8e21c3cdff 100644 --- a/test/fixtures/university/organizations.yml +++ b/test/fixtures/university/organizations.yml @@ -12,8 +12,9 @@ # kind :integer default("company") # long_name :string # name :string +# nic :string # phone :string -# sirene :string +# siren :string # slug :string # text :text # url :string diff --git a/test/models/university/organization_test.rb b/test/models/university/organization_test.rb index 12c7900224706b7468378ba91dedfb589d5f84e2..a57d401f936874cbe119b9daf79fbf03d9ee4f78 100644 --- a/test/models/university/organization_test.rb +++ b/test/models/university/organization_test.rb @@ -12,8 +12,9 @@ # kind :integer default("company") # long_name :string # name :string +# nic :string # phone :string -# sirene :string +# siren :string # slug :string # text :text # url :string