Code Monkey home page Code Monkey logo

Comments (6)

matt-riemer avatar matt-riemer commented on September 13, 2024

I would expect the collection there to be an ActiveRecord::Relation there. Can I see the whole datatable? Could be something weird going on.

from effective_datatables.

Nerian avatar Nerian commented on September 13, 2024

Here: https://gist.github.com/Nerian/d1391d2773acfbffb3b0b131fc986e41

from effective_datatables.

matt-riemer avatar matt-riemer commented on September 13, 2024

I think datatables is treating member_id as an array-based column, because Charge.new doesn't respond to member_id.

Try adding sql_column to the col line:

col :member_id, sql_column: 'invoices.member_id'

You might not even need a custom search method anymore!

from effective_datatables.

Nerian avatar Nerian commented on September 13, 2024

Nice :)

That fixes it. Should we consider this a bug or should I be adding this parameter in other places too?

from effective_datatables.

matt-riemer avatar matt-riemer commented on September 13, 2024

I don't consider this a bug.

Datatables is pretty smart about a single model (with it's belongs_to and has_many) but when you're doing crazy joins and such it needs a little bit of help :)

I will add to the documentation about this!

Thanks as always @Nerian

from effective_datatables.

Nerian avatar Nerian commented on September 13, 2024

Sounds good :) Thanks for your work. The new version is working quite well :)

from effective_datatables.

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.