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

fix: remove hard dependency on model-fragments #468

Conversation

luxzeitlos
Copy link
Contributor

using factory guy without model-fragments results in errors (at least on ember 4.4). this should fix this.

@GabrielCousin
Copy link
Contributor

Hi @luxferresum and thanks for the fix!
I tried this when upgrade our project to Ember 4.7 and it was not working completely (at least it solved the build but most of the tests were not passing anymore)

TypeError: Right-hand side of 'instanceof' is not an object
    at vendor.js:106676:39
    at vendor.js:65308:18
    at Map.forEach (<anonymous>)
    at TaskTemplate.eachAttribute (vendor.js:65307:23)
    at JSONAPIFixtureConverter.extractAttributes (vendor.js:106669:38)
    at JSONAPIFixtureConverter.convertSingle (vendor.js:107092:26)
    at JSONAPIFixtureConverter.convert (vendor.js:106568:21)
    at JSONAPIFixtureBuilder.convertForMake (vendor.js:106315:24)
    at FactoryGuy.make (vendor.js:107634:49)
    at Object.<anonymous> (tests.js:1416:60)

TaskTemplate is one our models. I added the following changes here https://github.com/MakeMusicInc/ember-data-factory-guy/commit/30cb1233111534376abfae08b3bfb205f43c3eb1
Do you think it would make sense to add this to that PR?

@patocallaghan
Copy link
Collaborator

@luxferresum yep we should fix this. If you can apply the fixes @GabrielCousin suggests I'll merge and do a new release

@luxzeitlos
Copy link
Contributor Author

@patocallaghan I merged the other commit.

@patocallaghan
Copy link
Collaborator

Great, thanks I'll follow up this evening 🙇

Copy link
Collaborator

@patocallaghan patocallaghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luxferresum looks like you have a lint error. I think we need to import require like in addon/factory-guy.js

@luxzeitlos luxzeitlos force-pushed the feat-fix-model-fragments-dependency branch from 30cb123 to 8a92759 Compare October 21, 2022 17:04
@patocallaghan patocallaghan merged commit 1d6cd99 into adopted-ember-addons:master Oct 21, 2022
@patocallaghan
Copy link
Collaborator

Thanks @luxferresum and @GabrielCousin 🙌

@patocallaghan
Copy link
Collaborator

Released in 3.9.11

mandyheg pushed a commit to intercom/ember-data-factory-guy that referenced this pull request Nov 1, 2022
)

* fix: remove hard dependency on model-fragments

* fix: instanceof Fragment and FragmentArray is not an object

Co-authored-by: Gabriel Cousin <7649529+GabrielCousin@users.noreply.github.com>
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.

None yet

3 participants