Skip to content
A Solidus extension to reuse images across variants.
Ruby HTML
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
app Use `#prepend` to decorate classes rather than `#class_eval` Apr 23, 2019
bin Default Spree Extension Dec 12, 2013
config
db/migrate
lib Remove lib from the autoload paths Sep 13, 2019
spec
.gitignore Setup for 1.0 release Aug 26, 2015
.rspec
Gemfile Remove Solidus < 2.5 conditionals Sep 13, 2019
LICENSE
README.md
Rakefile Rename extension to solidus_asset_variant_options. May 27, 2015
solidus_asset_variant_options.gemspec Relax sqlite3 dependency for Rails 6 compatibility Sep 13, 2019

README.md

Solidus Asset Variant Options

CircleCI

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

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"
You can’t perform that action at this time.