find_all is being deprecated, more info on how to use the alternative find_by_filter_values

Answered

Comments

3 comments

  • Andreas Haugstrup Pedersen

    Hi Vincent,

    While the find_all method is deprecated it will not be removed any time soon.

    find_by_filter_values has a simpler syntax. You can see all the options in the Views documentation: https://developers.podio.com/doc/filters

    Does that help?

    /Andreas

    0
    Comment actions Permalink
  • Hi there,

    It'd be really helpful if we had examples of find_by_filter_values usage. I can't find it anywhere. Google can't help me, the rubygem sources can't help me. Not even the documentation has a central place where we can look it up.

    I'm trying to fetch Podio::Item's that were last updated 'yesterday' which have a specific value on a field. I've figured out how to filter by the status, but not by ' last edited date ' yet:

    Podio::Item.find_by_filter_values(

      APP_ID, {

        status2: [2]

      }, {

        limit: 100,

        offset: 0

      }

    )[:all]

    Could you point me in the right direction?

    Thank you in advance,

     Léo

    0
    Comment actions Permalink
  • I just found a way:

    I've used Chrome's network inspector and sniffed what Podio's website does using ajax and translated it to a Ruby syntax and voila:

    Deliverable.find_by_filter_values(

      Deliverable::APP_ID,

      {

        status2: [2],

        last_edit_on: {from: from, to: to}

      }, {

        limit: MAX_ITEMS,

        offset: offset

      }

    )[:all]

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk