Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added meta to the uncountable array because "metum" is not a word. #513

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

ErvinSabic
Copy link
Contributor

@ErvinSabic ErvinSabic commented Dec 16, 2024

Added 'meta' to uncountable so it doesn't turn it into metum, which is not a word at least not in the typical programming sense when people use the word "meta" like "meta data"

Tests all passed for this change.

There was an issue mentioned previously about this usage here - #67

Which leads to the rails convention this library is keen on following. But the convention is wrong, they just refuse to fix it because it will break existing applications as mentioned here - rails/rails#34914

Though I'm not sure why they don't just create some sort of a deprecation warning. (I'm not a rails developer)

Anyone else who is running into this issue in the meantime can create a inflector-rules.js file inside of their app/initializers/ directory (create it if it doesn't exist) and add the following code as a work-around.

import Inflector from 'ember-inflector';

export function initialize() {
  const inflector = Inflector.inflector;

  inflector.irregular('meta', 'meta');
}

export default {
  name: 'inflector-rules',
  initialize
};

@runspired
Copy link

runspired commented Mar 12, 2025

meta is generally useful enough that probably we should do this if its not already a default; however, I think it might be? (its not)

note, i generally don't support the library adding its own rules #500 (review)

but meta is common enough it could be a good exception

@NullVoxPopuli NullVoxPopuli merged commit af9fa8e into emberjs:master Mar 12, 2025
15 checks passed
@github-actions github-actions bot mentioned this pull request Mar 12, 2025
@Techn1x
Copy link
Contributor

Techn1x commented Mar 13, 2025

Kind of related, If you're wondering how common it is, I've had this rule for half a decade in some apps
Inflector.inflector.uncountable('metadata')

EDIT: APIs should never have used english plurals for anything 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants