app/services/listing_service/store/shape.rb
# Note: If this method is needed in Category Store, then consider separating this code to
# own store, CategoryListingShapeStore
If this method is needed in Category Store, then consider separating this code to
own store, CategoryListingShapeStore
If this method is needed in Category Store then consider separating this code to own store CategoryListingShapeStore
def assign_to_categories!(community_id, shape_id)
    categories = CategoryModel.where(community_id: community_id)
    categories.pluck(:id).each { |category_id|
      CategoryListingShapeModel.create!(category_id: category_id, listing_shape_id: shape_id)
    }
  end
def assign_to_categories! ( community_id , shape_id ) categories = CategoryModel . where ( community_id : community_id ) categories . pluck ( :id ) . each { | category_id | CategoryListingShapeModel . create! ( category_id : category_id , listing_shape_id : shape_id ) } end
Note: If this method is needed in Category Store, then consider separating this code to
own store, CategoryListingShapeStore
Note : If this method is needed in Category Store then consider separating this code to own store CategoryListingShapeStore
community_id
shape_id