---
- !ruby/object:Comment
attributes:
post_id: '5'
changed_attributes: {}
previously_changed: {}
attributes_cache: {}
marked_for_destruction: false
destroyed: false
readonly: false
new_record: false
- !ruby/object:Comment
attributes:
post_id: '6'
changed_attributes: {}
previously_changed: {}
attributes_cache: {}
marked_for_destruction: false
destroyed: false
readonly: false
new_record: false
- !ruby/object:Comment
attributes:
post_id: '3'
changed_attributes: {}
previously_changed: {}
attributes_cache: {}
marked_for_destruction: false
destroyed: false
readonly: false
new_record: false
- !ruby/object:Comment
attributes:
post_id: '7'
changed_attributes: {}
previously_changed: {}
attributes_cache: {}
marked_for_destruction: false
destroyed: false
readonly: false
new_record: false
- !ruby/object:Comment
attributes:
post_id: '1'
changed_attributes: {}
previously_changed: {}
attributes_cache: {}
marked_for_destruction: false
destroyed: false
readonly: false
new_record: false
(http://pastebin.com/J1angM6d)
Как я могу получить значение post_id
в виде массива? @arr = [ 5,6,3,7,1 ]
Теперь я хочу получить эти сообщения с этим post_id
. Это правильно? @p = Post.where(:id=>@arr)