Skip to content

Conversation

@haschu
Copy link
Contributor

@haschu haschu commented May 26, 2019

Closes #4190

In addition to

@OneToOne(type => Profile)
@ManyToOne(type => User, user => user.photos)
@ManyToMany(type => Category)

now it's also possible to write:

@OneToOne('Profile')
@ManyToOne('User','photos')
@ManyToMany('Category')

Using this approach can prevent circular dependency issues when TypeORM is used within a frontend/browser application (e.g. when running through Angular CLI).

@haschu
Copy link
Contributor Author

haschu commented May 26, 2019

Cool, tests failed for Node.js 9! I'm not sure if that's related to my changes... Error in before each, can anybody restart it?

Edit: So I ran the tests locally on Node v9.11.2 and they passed :/

@rustamwin rustamwin requested a review from pleerock May 28, 2019 12:18
@pleerock
Copy link
Member

Thanks, it's a good change. We should have it much earlier.

@pleerock pleerock merged commit 56547ba into typeorm:master May 30, 2019
@pleerock
Copy link
Member

Oh, we should make a change in a changelog .

@rustamwin rustamwin removed the request for review from pleerock May 30, 2019 05:28
@haschu
Copy link
Contributor Author

haschu commented May 30, 2019

Argh... sorry, I overlooked the changelog part in CONTRIBUTING.md - going to submit a PR to fix that soon.

I also realized, that typeorm-class-transformer-shim.js wouldn't work with the "string instead of typeFunction" approach. I'm also trying to fix that soon.

@pleerock Thank you so much for the fast merge - I have noticed that you're struggling at the moment to find enough time for TypeORM. I really appreciate it, as my team is migrating our in-house framework to TypeORM and we were stuck at this point. And also thanks for your effort to bring up such an amazing project! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relation decorators: allow to pass string instead of typeFunction

2 participants