diff --git a/app/admin/organisation.rb b/app/admin/organisation.rb index 5acc929..2357eb3 100644 --- a/app/admin/organisation.rb +++ b/app/admin/organisation.rb @@ -5,7 +5,7 @@ # [+Copyright:+] Digital Curation Centre and University of California Curation Center ActiveAdmin.register Organisation do - permit_params :abbreviation, :banner_file_id, :description, :domain, :logo_file_id, :name, :stylesheet_file_id, :target_url, :organisation_type_id, :wayfless_entity, :parent_id + permit_params :abbreviation, :banner_file_id, :description, :logo_file_id, :name, :target_url, :organisation_type_id, :wayfless_entity, :parent_id menu :priority => 14, :label => proc{I18n.t('admin.org')}, :parent => "Organisations management" @@ -59,7 +59,6 @@ end # row :target_url row :logo_file_name - row :domain row :wayfless_entity row I18n.t('admin.token_permission_type') do (organisation.token_permission_types.map{|tpt| link_to tpt.token_type, [:admin, tpt]}).join(', ').html_safe @@ -89,7 +88,6 @@ # f.input :target_url f.input :banner_text f.input :logo_file_name - f.input :domain f.input :wayfless_entity f.input :token_permission_types, label: I18n.t('admin.token_permission_type'), as: :select, multiple: true, include_blank: I18n.t('helpers.none'), diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 004fcf4..14c5672 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -21,8 +21,8 @@ accepts_nested_attributes_for :dmptemplates accepts_nested_attributes_for :token_permission_types - attr_accessible :abbreviation, :banner_text, :logo, :remove_logo, :domain, - :logo_file_name, :name, :stylesheet_file_id, :target_url, + attr_accessible :abbreviation, :banner_text, :logo, :remove_logo, + :logo_file_name, :name, :target_url, :organisation_type_id, :wayfless_entity, :parent_id, :sort_name, :token_permission_type_ids, :language_id, :contact_email diff --git a/db/migrate/20161115124634_remove_unused_fields_from_organisations.rb b/db/migrate/20161115124634_remove_unused_fields_from_organisations.rb new file mode 100644 index 0000000..f97fe8d --- /dev/null +++ b/db/migrate/20161115124634_remove_unused_fields_from_organisations.rb @@ -0,0 +1,6 @@ +class RemoveUnusedFieldsFromOrganisations < ActiveRecord::Migration + def change + remove_column :organisations, :stylesheet_file_id, :integer + remove_column :organisations, :domain, :string + end +end diff --git a/db/seeds.rb b/db/seeds.rb index 91a4fde..8b1b243 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -126,7 +126,6 @@ organisation_type: "Organisation", description: "An example: Regional Curation Center concerned with research data management (typically the organization hosting this website)", banner_text: "Example: Your Regional Curation Center", - domain: "example.regionalcurationcenter.org", region: 'UK', language: 'English(UK)' }, @@ -137,7 +136,6 @@ organisation_type: "Funder", description: "An example: Research funding agency", banner_text: "Example: Global Research Center", - domain: "example.globalresearchcenter.org", region: 'UK', language: 'English(UK)' }, @@ -148,14 +146,12 @@ organisation_type: "Funder", description: "An example: Regional funding agency for scientific research", banner_text: "Example: Regional Science Federation", - domain: "example.regionalsciencefederation.org", region: 'UK', language: 'English(UK)' }, 'Example Institution'=> { name: "Capital City College", abbreviation: "CapColl", - domain: "example.capitalcitycollege.edu", sort_name: "CapitalCityCollege", organisation_type: "Institution", description: "An example: Academic institution", @@ -170,7 +166,6 @@ organisation = Organisation.new organisation.name = details[:name] organisation.abbreviation = details[:abbreviation] - organisation.domain = details[:domain] organisation.sort_name = details[:sort_name] organisation.organisation_type = OrganisationType.find_by_name(details[:organisation_type]) organisation.region_id = Region.find_by_name(details[:region]).id @@ -223,24 +218,6 @@ end end -user_role_types = { - 'admin' => { - name: 'admin' - }, - 'org_admin' => { - name: 'org_admin' - }, - 'user' => { - name: 'user' - } -} - -user_role_types.each do |urt, details| - if UserRoleType.where(name: details[:name]).empty? - UserRoleType.create(name: details[:name]) - end -end - users = { 'Super admin' => { email: "super_admin@example.com",