Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed #465, destoyed product should not be contain in smart collection.
- Loading branch information
Showing
9 changed files
with
55 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
%li.product-edit-collection | ||
=check_box_tag 'product[collection_ids][]', collection.id, product.collections.include?(collection) || (collection.handle == 'frontpage' and collection.products.size.zero?), id: "collection_#{collection.id}" | ||
=check_box_tag 'product[collection_ids][]', collection.id, product.custom_collections.include?(collection) || (collection.handle == 'frontpage' and collection.products.size.zero?), id: "collection_#{collection.id}" | ||
%label(for="collection_#{collection.id}")=collection.title |
9 changes: 9 additions & 0 deletions
9
db/migrate/20120815032021_remove_destroyed_smart_collection_product.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class RemoveDestroyedSmartCollectionProduct < ActiveRecord::Migration | ||
def up | ||
SmartCollection | ||
SmartCollectionProduct.all.select{|smart_collection_product| smart_collection_product.product.nil? }.map(&:destroy) | ||
end | ||
|
||
def down | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters