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

Deprecate complex objects as an attributes defaultValue. #3855

Merged
merged 1 commit into from
Oct 14, 2015

Conversation

bmac
Copy link
Member

@bmac bmac commented Oct 14, 2015

They often do not work how a user expects.
Closes #3766

@wecc
Copy link
Contributor

wecc commented Oct 14, 2015

👏

@@ -226,7 +226,13 @@ function getDefaultValue(record, options, key) {
if (typeof options.defaultValue === "function") {
return options.defaultValue.apply(null, arguments);
} else {
return options.defaultValue;
let defaultValue = options.defaultValue;
Ember.deprecate(`Non primative defaultValues are deprecated because they are shared between all instances. If you would like to use a complex object as a default value please provide a function that returns the complex object.`,
Copy link
Contributor

Choose a reason for hiding this comment

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

small typo 'primitive'

They often do not work how a user expects.
Closes emberjs#3766
@bmac bmac force-pushed the deprecate-complex-default-values branch from eabaa57 to 44044fd Compare October 14, 2015 09:46
@igorT
Copy link
Member

igorT commented Oct 14, 2015

❤️

igorT added a commit that referenced this pull request Oct 14, 2015
Deprecate complex objects as an attributes `defaultValue`.
@igorT igorT merged commit ee6b4a8 into emberjs:master Oct 14, 2015
@bmac bmac deleted the deprecate-complex-default-values branch October 14, 2015 10:11
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.

4 participants