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

[BUGFIX Release-1-13] Added deprecation for Ember.SortableMixin. #12471

Merged
merged 1 commit into from
Nov 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ QUnit.module("ember-htmlbars: Ember.Select - usage inside templates", {

QUnit.test("works from a template with bindings [DEPRECATED]", function() {
expectDeprecation(arrayControllerDeprecation);
expectDeprecation(/Ember.SortableMixin/);
var Person = EmberObject.extend({
id: null,
firstName: null,
Expand Down
5 changes: 5 additions & 0 deletions packages/ember-runtime/lib/mixins/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ export default Mixin.create(MutableEnumerable, {
*/
sortFunction: compare,

init() {
this._super(...arguments);
Ember.deprecate(`Ember.SortableMixin is deprecated and was used in ${this}. Please use Ember.computed.sort instead.`, this.isGenerated);
},

orderBy(item1, item2) {
var result = 0;
var sortProperties = get(this, 'sortProperties');
Expand Down
2 changes: 2 additions & 0 deletions packages/ember-runtime/tests/mixins/sortable_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ QUnit.module("Ember.Sortable");
QUnit.module("Ember.Sortable with content", {
setup() {
run(function() {
expectDeprecation(/Ember.SortableMixin/);

var array = [{ id: 1, name: "Scumbag Dale" }, { id: 2, name: "Scumbag Katz" }, { id: 3, name: "Scumbag Bryn" }];

unsortedArray = Ember.A(Ember.A(array).copy());
Expand Down
2 changes: 2 additions & 0 deletions packages/ember/tests/routing/basic_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ActionManager from "ember-views/system/action_manager";
import EmberView from "ember-views/views/view";
import { arrayControllerDeprecation } from "ember-runtime/controllers/array_controller";


import EmberHandlebars from "ember-htmlbars/compat";

var compile = EmberHandlebars.compile;
Expand Down Expand Up @@ -628,6 +629,7 @@ QUnit.test("The Homepage with a `setupController` hook modifying other controlle

QUnit.test("The Homepage with a computed context that does not get overridden", function() {
expectDeprecation(arrayControllerDeprecation);
expectDeprecation(/Ember.SortableMixin/);

Router.map(function() {
this.route("home", { path: "/" });
Expand Down