Skip to content

Rename Metadata to CategoryType #709

@maebeale

Description

@maebeale

The word Metadatum was confusing to us, so we are going to use CategoryType instead (because it's the parent of Category).

We had to wait until we imported their old data (now complete) before renaming the metadata table and deleting/renaming/converting remaining files. As a first step in the transition, we created the CategoryType model and started to reference it instead of Metadatum. Now, we need to complete the work by doing following.

Next steps are:

  • rename the table and foreign keys to category_types and category_type_id
  • rename raw SQL references to the old table, e.g. @age_ranges = Category.includes(:category_type).where("metadata.name = 'AgeRange'").pluck(:name) should be category_types.name
  • remove Metadatum model and anything that references it and change to CategoryType
  • remove MetadatumDecorator, metadata factory
  • after the above, change CategoryType model to not set the table_name, since it'll automagically connect to the newly renamed category_types table
  • change filename and contents of spec/models/metadatum_spec to spec/models/category_type_spec

If you notice anything else needed to completely remove metadata/metadatum that's not listed above, please add it to this PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions