Giter VIP home page Giter VIP logo

Comments (2)

paweljw avatar paweljw commented on July 24, 2024

Thanks!

It seems that I've made a mistake of following what I know blindly. In a "regular" Rails application, not_implemented will be present:

5.0.2 @ 2.4.0 (main)>not_implemented
NotImplementedError: class Object must implement abstract method '()'.

If we dig for the source, we'll see this:

5.0.2 @ 2.4.0 (main)>show-source not_implemented

From: /Users/pjw/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/erubis-2.7.0/lib/erubis/util.rb @ line 11:
Owner: Kernel
Visibility: private
Number of lines: 9

def not_implemented     #:doc:
  backtrace = caller()
  method_name = (backtrace.shift =~ /`(\w+)'$/) && $1
  mesg = "class #{self.class.name} must implement abstract method '#{method_name}()'."
  #mesg = "#{self.class.name}##{method_name}() is not implemented."
  err = NotImplementedError.new mesg
  err.set_backtrace backtrace
  raise err
end

So this is defined in erubis, which is pulled in by actionview. In an API app erubis is not pulled in, so not_implemented is missing.

I always assumed that this method is defined by ActiveSupport :) Thanks for pointing this out, I hope we've both learned something today - I certainly did! I'll fix the code (whenever I get the time to do that) to just throw NotImplementedError instead.

from bookstore-backend.

esparkman avatar esparkman commented on July 24, 2024

I definitely learned something new from it. Maybe I'll attempt a PR for you or something. Looking forward to the Vue portion as well.

I have a Rails API + Vue app going using Knock at the moment. I'm always down to figure out how to take some of the magic out of it though.

Thanks for quick and informative response.

from bookstore-backend.

Related Issues (1)

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.