0
我在學習上軌Ruby和Ruby,我已經一個問題:問題上的PGresult和ActiveRecord的:: Base.connection的回報()執行
我想知道我是否可以使用在pgresult上選擇方法。
這是我的代碼:
connection = ActiveRecord::Base.connection()
allinfosql = "SELECT applications.appli_name, folders.folder_name, folders.is_obsolete, strategies.strategy_name
FROM applications, folders, strategies, folders_strategies
WHERE strategies.id = folders_strategies.strategy_id
AND folders_strategies.folder_id = folders.id
AND folders.application_id = applications.id
ORDER BY applications.appli_name, folders.folder_name ASC"
@allinfos = connection.execute(allinfosql)
我試圖做到這一點
test = @allinfos.select {|row| row['appli_name']="SOME_VALUE"}
但結果是測試等於@allinfos
感謝您的幫助