Coder Social home page Coder Social logo

undefined method arrange about ancestry HOT 5 CLOSED

stefankroes avatar stefankroes commented on June 13, 2024
undefined method arrange

from ancestry.

Comments (5)

stefankroes avatar stefankroes commented on June 13, 2024

The find(:all) of simply all method returns an array. Please invoke arrange on scope like so: Model.arrange of istance.subtree.arange.

from ancestry.

wavesmachine avatar wavesmachine commented on June 13, 2024

Thanks man, that solved it.

from ancestry.

dankozlowski avatar dankozlowski commented on June 13, 2024

So, instead of

= nested_messages @comments.arrange(:order => :created_at)

What would I use to return something .arrange can use?

from ancestry.

wavesmachine avatar wavesmachine commented on June 13, 2024

@comments = Comment.scoped in the controller

from ancestry.

sijbrandij avatar sijbrandij commented on June 13, 2024

Hello Stefan,
I am dealing with a similar problem; for managers, I retrieve their groups based on the current_account. I can call arrange on the array returned by the find
For administrators however, I retrieve all groups, grouped by account. In my index view, I do @groups.each do |account, groups|. Somehow, I can't call arrange on groups, even though the class of groups is array, like the array returned for a manager.
I tried your suggestion about scopes, but I am struggling to create something that does retrieve everything, and will allow me to group by account.
Your help is greatly appreciated :)

from ancestry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.