質問編集履歴
1
追記
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
複数の配列を結合するのに、
|
|
2
2
|
```ruby
|
|
3
|
-
EventUser.where(user_id: [user.
|
|
3
|
+
EventUser.where(user_id: [user.id, user.followings.ids])
|
|
4
4
|
```
|
|
5
|
-
のように書くと、Representation of type Array cannot be mergedって怒られます!
|
|
5
|
+
のように書くと、POSTMANでRepresentation of type Array cannot be mergedって怒られます!
|
|
6
6
|
なので
|
|
7
7
|
```ruby
|
|
8
8
|
user_ids = [user.id, [user.followings.ids]].flatten
|
|
9
9
|
EventUser.where(user_id: user_ids)
|
|
10
10
|
```
|
|
11
11
|
のように書いたのですが、またもや同じエラーが返ってきます!
|
|
12
|
-
配列を結合する方法を知っている方いましたら助けてください
|
|
12
|
+
配列を結合する方法を知っている方いましたら助けてください笑
|
|
13
|
+
|
|
14
|
+
ちなみに
|
|
15
|
+
```ruby
|
|
16
|
+
user_ids = user.followings.ids << user.id
|
|
17
|
+
EventUser.where(user_id: user_ids)
|
|
18
|
+
```
|
|
19
|
+
でもダメでした、、、
|