我有這樣的路線: Rails.application.routes.draw do
root 'login#new'
get '/home/inicio', to: 'home#index'
scope '/login' do
get '/acesso', to:'login#new'
post '/acessorecebendo', to:'
如何創建一個ActiveRecord查詢以下SQL查詢 SELECT device1.*
FROM devices device1
WHERE device1.id = (SELECT MAX(device2.id)
FROM devices device2
WHERE device2.user_id = device1.user_id);
我Device模
我有具有用於存儲用戶的部份資料圖片一上傳carrierwave class User < ActiveRecord::Base
mount_uploader :profilepic, LogoUploaderUploader
我想緩存在此redis的用戶對象的用戶模型的ActiveRecord模型對象。雖然我緩存調用的activerecord對象上to_json方法其中profile