-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kunpeng Liu
committed
Sep 14, 2014
1 parent
31759b6
commit d188541
Showing
10 changed files
with
132 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
# Ignore bundler config. | ||
/.bundle | ||
/.idea/ | ||
|
||
# Ignore the default SQLite database. | ||
/db/*.sqlite3 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
31 changes: 31 additions & 0 deletions
31
db/migrate/20140914051831_add_slider_taxons_and_apply_them.spree_fancy.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,31 @@ | ||
# This migration comes from spree_fancy (originally 20121211151950) | ||
class AddSliderTaxonsAndApplyThem < ActiveRecord::Migration | ||
def up | ||
tags = Spree::Taxonomy.create(:name => 'Tags') | ||
slider = Spree::Taxon.create({:taxonomy_id => tags.id, :parent_id => tags.root.id, :name => 'Slider'}) | ||
featured = Spree::Taxon.create({:taxonomy_id => tags.id, :parent_id => tags.root.id, :name => 'Featured'}) | ||
latest = Spree::Taxon.create({:taxonomy_id => tags.id, :parent_id => tags.root.id, :name => 'Latest'}) | ||
|
||
products = Spree::Product.all | ||
|
||
if products[6] | ||
products[0..6].each do |product| | ||
product.taxons << slider | ||
end | ||
end | ||
|
||
if products[15] | ||
products[4..15].each do |product| | ||
product.taxons << featured | ||
end | ||
|
||
products[0..12].each do |product| | ||
product.taxons << latest | ||
end | ||
end | ||
end | ||
|
||
def down | ||
Spree::Taxonomy.where(:name => 'Tags').destroy_all | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
//= require spree/frontend | ||
|
||
//= require_tree . | ||
//= require spree/fancy |
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 |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
*= require_self | ||
*= require_tree . | ||
*= require spree/fancy | ||
*/ |