?
Rails4 中scope推荐写法,代替原先的lambda
class="ruby"> scope :all_by_shop, ->(store_id) {where("(receiver_id = ? AND receiver_type = 'User') OR (sender_id = ? AND sender_type = 'User')", store_id, store_id)}