{"action":"opened","issue":{"url":"https://api.github.com/repos/locomotivecms/engine/issues/1093","labels_url":"https://api.github.com/repos/locomotivecms/engine/issues/1093/labels{/name}","comments_url":"https://api.github.com/repos/locomotivecms/engine/issues/1093/comments","events_url":"https://api.github.com/repos/locomotivecms/engine/issues/1093/events","html_url":"https://github.com/locomotivecms/engine/issues/1093","id":121218180,"number":1093,"title":"`with_scope photo.ne: nil` returns 0 records - only Engine","user":{"login":"adam-pl","id":2798350,"avatar_url":"https://avatars.githubusercontent.com/u/2798350?v=3","gravatar_id":"","url":"https://api.github.com/users/adam-pl","html_url":"https://github.com/adam-pl","followers_url":"https://api.github.com/users/adam-pl/followers","following_url":"https://api.github.com/users/adam-pl/following{/other_user}","gists_url":"https://api.github.com/users/adam-pl/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-pl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-pl/subscriptions","organizations_url":"https://api.github.com/users/adam-pl/orgs","repos_url":"https://api.github.com/users/adam-pl/repos","events_url":"https://api.github.com/users/adam-pl/events{/privacy}","received_events_url":"https://api.github.com/users/adam-pl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-09T11:40:58Z","updated_at":"2015-12-09T11:40:58Z","closed_at":null,"body":"1. We have content_type `partners`\r\n    ```\r\n    name: Partners\r\n    slug: partners\r\n    description: \"XXX\"\r\n    label_field_name: name\r\n    order_by: manually\r\n    order_direction: asc\r\n    \r\n    fields: \r\n    - name:\r\n        label: Name\r\n        type: string\r\n        required: true\r\n        hint: \"Partner Name\"\r\n        localized: false\r\n\r\n    - photo:\r\n        label: \"Photo\"\r\n        type: belongs_to\r\n        required: false\r\n        hint: \"Partner's Logo\"\r\n        localized: false  \r\n        class_name: photos\r\n    ```\r\n2. We have content_type `photos`\r\n    ```\r\n    name: \"Photos\"\r\n    slug: photos\r\n    description: \"Photos .jpg, .png\"\r\n    label_field_name: name\r\n    order_by: posted_at\r\n    order_direction: desc\r\n\r\n    fields: \r\n    - name: \r\n        label: Name\r\n        type: string\r\n        required: true\r\n        hint: \"Name\"\r\n        localized: false\r\n\r\n    - posted_at:\r\n        label: \"Post at\"\r\n        type: date_time\r\n        required: true\r\n        hint: \"Post at\"\r\n        localized: false\r\n\r\n    - image:\r\n        label: Image\r\n        type: file\r\n        required: true\r\n        hint: \"File (.jpg, .png)\"\r\n        localized: false\r\n\r\n    - partners:\r\n        label: Partner\r\n        type: has_many\r\n        required: false\r\n        hint: \"Partner assigned to this photo\"\r\n        localized: false\r\n        class_name: partners\r\n        inverse_of: photo\r\n        ui_enabled: true\r\n    ```\r\n3. We want to filter Partners's photos that are not nil:\r\n\r\n    ```\r\n    {% with_scope photo.ne: nil %}\r\n      {% assign images = contents.partners.all | map: 'photo' %}\r\n    {% endwith_scope %}\r\n    ```\r\n4. We have defined some photos and partners data.\r\n\r\nWHATS WRONG\r\n  - the Engine returns 0 records (images.size is equal to zero)\r\n\r\nIT SHOULD BE \r\n  - the Engine should return non-zero records (images.size should be greater to zero)\r\n\r\nINFO\r\n  - the Wagon works fine (images.size is greater to zero)\r\n  - if we remove section `with_scope photo.ne: nil` the Engine returns non-empty array\r\n  - gems used in the Engine (listed with `bundle | grep locomotive`):\r\n\r\n    ```\r\n    Using locomotivecms-liquid 4.0.0\r\n    Using locomotivecms-solid 4.0.1\r\n    Using locomotivecms_common 0.0.5\r\n    Using locomotivecms_steam 1.0.0.rc8 from https://github.com/locomotivecms/steam.git (at master)\r\n    Using locomotivecms 3.0.0.rc5 from https://github.com/locomotivecms/engine.git (at master)\r\n    ```\r\n  - gems used in the Wagon: \r\n\r\n    ```\r\n    Using locomotivecms-liquid 4.0.0\r\n    Using locomotivecms-solid 4.0.1\r\n    Using locomotivecms_coal 1.0.0.rc3\r\n    Using locomotivecms_common 0.0.5\r\n    Using locomotivecms_steam 1.0.0.rc8 from https://github.com/locomotivecms/steam.git (at master)\r\n    Using locomotivecms_wagon 2.0.0.rc5\r\n    ```\r\n"}}