回答編集履歴
1
生SQLアクセスの結果はハッシュの配列で戻ってくるので、それに修正
answer
CHANGED
@@ -20,6 +20,6 @@
|
|
20
20
|
```Ruby
|
21
21
|
# 生のSQLを使って取得する
|
22
22
|
result = ActiveRecord::Base.connection.select("select abstract from team_members where user_id = 0 and team_id = 1 limit 1")
|
23
|
-
# => resultの中身は{abstract => 'hoge'}
|
23
|
+
# => resultの中身は[{abstract => 'hoge'}]
|
24
|
-
result[:abstract]
|
24
|
+
result.first[:abstract]
|
25
25
|
```
|