Code Monkey home page Code Monkey logo

Comments (6)

dspaeth-faber avatar dspaeth-faber commented on May 18, 2024

Your end seems to be in the wrong line. attr_not_on_wrapped_object is a method of the module and not of the class.

from grape-entity.

dblock avatar dblock commented on May 18, 2024

^^^ @dspaeth-faber

from grape-entity.

stabenfeldt avatar stabenfeldt commented on May 18, 2024

You're right! Sorry, my fault. :-)

from grape-entity.

stabenfeldt avatar stabenfeldt commented on May 18, 2024

I encountered a new problem with Runtime Exposure after I fixed this first mistake.
It only occours when I add :project_url to expose.

  1) V1::Users GET /api/v1/users/:id/unconfirmed_tasks returns Tasks
     Failure/Error: get "/api/v1/users/#{ user.id }/unconfirmed_tasks"
     ArgumentError:
       ArgumentError
     # ./spec/api/users_spec.rb:38:in `block (3 levels) in <top (required)>'
module V1
  module Entities

    class Tasks < Grape::Entity
      expose :id, :description, :project_id, :project_url
    end

    def project_url
      'http://db.no/'
    end

  end
end
describe V1::Users do

  describe 'GET /api/v1/users/:id/unconfirmed_tasks', focus: true do
    it 'returns Tasks' do
      get "/api/v1/users/#{ user.id }/unconfirmed_tasks"  # Line 38
      array.first['project_url'].should eq 'http://db.no/'
    end
  end

from grape-entity.

dspaeth-faber avatar dspaeth-faber commented on May 18, 2024

Same issue again. project_url is not a method of the class Tasks

from grape-entity.

stabenfeldt avatar stabenfeldt commented on May 18, 2024

Sorry, I'm being a bit slow here. 😳

from grape-entity.

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.