Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheritance issue with the grape-entity version >= 0.5.0 #365

Open
hay-wtag opened this issue Jun 6, 2022 · 0 comments
Open

Inheritance issue with the grape-entity version >= 0.5.0 #365

hay-wtag opened this issue Jun 6, 2022 · 0 comments

Comments

@hay-wtag
Copy link

hay-wtag commented Jun 6, 2022

module API
  module V1
    module Entities
      class A < Grape::Entity
        expose :k 
        expose :l
        expose :status 

        def status
         'HI'
        end
      end
    end
  end
end
module API
  module V101
    module Entities
      class A < V1::Entities::A
        expose :status

        def status
         'BYE'
        end
      end
    end
  end
end

In this case, when I am calling the V101 it is calling the status function of V1 instead of the V101 at first. This means - first it is executing the status function of v1 and then v101. This code perfectly works with the grape-entity version = 0.4.8 where it only calls the function of v101 when I call with v101. After version >= 0.5 this code does not behave as before. Ami I missing something? Thank you!

Related Configuration
rails: 5.2
grape: 1.6.2
@hay-wtag hay-wtag changed the title Inheritance issue with the grape-entity version 0.10.1 Inheritance issue with the grape-entity version >= 0.5.0 Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant