Using image assets across multiple variants
Ruby HTML
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db/migrate
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
circle.yml
solidus_asset_variant_options.gemspec

README.md

Solidus Asset Variant Options

Adds the ability for admins to use the same image asset for multiple variants. Originally a fork of jpdesigndev/spree_asset_variant_options.

Build Status

Installation

Add solidus_asset_variant_options to your Gemfile:

gem "solidus_asset_variant_options"

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g solidus_asset_variant_options:install

Since this extension changes the way images are associated, if you've got any existing ones you'll need to add the association back in. This can be accomplished by running:

Spree::Image.find_each do |image|
  if image.viewable_type == "Spree::Variant"
    image.variants << image.viewable
  end
end

Afterwards it is recommended to consolidate the images in the admin.

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle exec rake

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require "spree_asset_variant_options/factories"