Coder Social home page Coder Social logo

Comments (11)

ashchan avatar ashchan commented on July 18, 2024

lib/api. code is documentation.

from homeland.

crossle avatar crossle commented on July 18, 2024

OK ,3Q

from homeland.

crossle avatar crossle commented on July 18, 2024

咨询一下。。。Grape::Entity 这个的主要作用是什么? 还有expose ?

from homeland.

ashchan avatar ashchan commented on July 18, 2024

Grape::Entity对应相应的ActiveRecord对象(我们不直接暴露AR对象,那样既无必要也容易返回敏感数据),expose用于指定要在api中暴露出去的属性。

from homeland.

crossle avatar crossle commented on July 18, 2024

Grape::Entity 可以来自不同的ActiveRecord吗?因为我想从不同的表查询出数据。。。如果可以,怎样表示呢?谢谢非常

from homeland.

ashchan avatar ashchan commented on July 18, 2024

可以啊。你看现在的代码能找到这样的用法。

iPhoneから送信

On 2012/05/10, at 1:54, [email protected] wrote:

Grape::Entity 可以来自不同的ActiveRecord吗?因为我想从不同的表查询出数据。。。如果可以,怎样表示呢?谢谢非常


Reply to this email directly or view it on GitHub:
#25 (comment)

from homeland.

crossle avatar crossle commented on July 18, 2024

class Reply < Grape::Entity
expose :_id, :body, :body_html, :message_id, :created_at, :updated_at
expose :user, :using => APIEntities::User
end
是这样的吧? expose :user, :using => APIEntities::User 意思是返回的时候也返回。每条回复的user entity是吧?大神。。。

from homeland.

crossle avatar crossle commented on July 18, 2024

ruby-china 中的 spec目录是干什么用的?

from homeland.

crossle avatar crossle commented on July 18, 2024

还有ruby-china中的site-node表db文件是再哪里 啊?我怎么没有找到?谢谢

from homeland.

tiemei avatar tiemei commented on July 18, 2024

spec: test site-node: db/schema.rb

from homeland.

crossle avatar crossle commented on July 18, 2024

db/schema.rb中没有site-node表的结构。。。。。

from homeland.

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.