阅读背景:

如何使用变量引用类常量

来源:互联网 

I have a class:

我上课了:

class VoteType < MyModel
    UPVOTE          = where(slug: "up-vote").pluck(:id).first
    DOWNVOTE        = where(slug: "down-vote").pluck(:id).first
    FAVORITE        = where(slug: "favorite").pluck(:id).first
    SPAM                = where(slug: "spam").pluck(:id).first
end
class VoteType < MyMo



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: