0
我的模型是這樣的。我在Mongoid中使用Kaminari並設置每頁默認結果。Kaminari paginates_per與Mongoid不起作用
class SavedTweet
include Mongoid::Document
field :slug, :type => String
field :created_at, :type => DateTime, :default => Time.now
has_many :tweets, :order => :created_at.desc
end
class Tweet
include Mongoid::Document
paginates_per 30 #default per page
field :tweet_id, type: String
field :html, type: String
field :created_at, type: DateTime
belongs_to :saved_tweet
end
,這是我的查詢
SavedTweet.find_by(slug: "slug")
我期待只得到30鳴叫回來,而是我得到的一切回來。我錯過了明顯的東西嗎?