Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def random
- @previous_random_item_id = params[:id] || 0
- @items = Item.pending.
- joins(xxxxxxxxxxxxx).
- where(xxxxxxxxxxxx).
- where("items.id != ?", @previous_random_item_id)
- @random_item = @items.offset(rand @items.count).first
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement