Uncaught TypeError: this.get(...).toArray is not a function(…)
<p>I have some trouble with my Ember.js model/controller.</p>

<p>My code generates this error:</p>

<pre><code>Uncaught TypeError: this.get(...).toArray is not a function(…)
</code></pre>

<p>I have a structure like this:</p>

<p><em>router.js</em></p>

<pre><code>Router.map(function() {

  this.route('search', function() {
    this.route('detail', { path: '/:search_id' });
    this.route('ranks', { path: '/:search_id/ranks' });
    this.route('tweets', { path: '/:search_id/tweets' });
  });
});

export default Router;
</code></pre>

<p><em>route/search.js</em></p>

<pre><code>import Ember from 'ember';

export default Ember.Route.extend({
});
</code></pre>

<p><em>route/search/rank.js</em></p>

<pre><code>export default Ember.Route.extend({

    model(params) {
        return this.get('store').findRecord('search', params.search_id);
    },

    setupController: function(controller, model) {
        controller.set('model', model);
    }
});
</code></pre>

<p><em>app/models/rank.js</em></p>

<pre><code>export default DS.Model.extend({
    date: DS.attr(),
    tag: DS.attr('string'),
    rank: DS.attr('number'),
    freq: DS.attr('number'),

    search: DS.belongsTo('search')
});
</code></pre>

<p><em>app/models/search.js</em></p>

<pre><code>export default DS.Model.extend({
    uniqueid: DS.attr('string'),
    idate: DS.attr('date'),
    fdate: DS.attr('date'),
    keywords: DS.attr(),

    ranks: DS.hasMany('rank')
});
</code></pre>

<p><em>app/controllers/search.js</em></p>

<pre><code>export default Ember.Controller.extend({
});
</code></pre>

<p><em>app/controllers/search/rank.js</em></p>

<pre><code>export default Ember.Controller.extend({

    mydata: Ember.computed('model', function() {

       this.get('model').forEach(function(item) {
          console.log(item);
       });
    });
});
</code></pre>