diff --git a/guides/getting-started/forking-solidus.md b/guides/getting-started/forking-solidus.md new file mode 100644 index 00000000000..07962536187 --- /dev/null +++ b/guides/getting-started/forking-solidus.md @@ -0,0 +1,33 @@ +# Forking Solidus + +If your store requires deep customizations to Solidus's core functionality, you +may want to fork Solidus for your store where you can more freely implement your +features. + +Note that this can complicate your Solidus upgrade process or can break other +Solidus extensions you may wish to use. + +The benefit of using a fork of Solidus is that you can test your new features +with Solidus's test suite and ensure your development has not broken Solidus's +existing functionality. + +You can reference a fork of Solidus in your `Gemfile` this way: + +```ruby +gem 'solidus', git: 'https://github.com/my_account/solidus.git', branch: "my-new-feature" +``` + +If you think your feature (or fix) is of interest to the wider Solidus +community, [consider making a pull request][contributing]. + +[contributing]: https://github.com/solidusio/solidus/blob/master/CONTRIBUTING.md + +## Create a "private fork" + +If your organization needs to work in a private repository for any reason, +forking Solidus becomes slightly more complicated. GitHub does not allow you to +create private forks of public repositories. Instead, you can duplicate the +repository. See GitHub's [Duplicating a repository][duplicating] article for +more information. + +[duplicating]: https://help.github.com/articles/duplicating-a-repository/ diff --git a/guides/getting-started/private-solidus-fork.md b/guides/getting-started/private-solidus-fork.md deleted file mode 100644 index 668ef7d0836..00000000000 --- a/guides/getting-started/private-solidus-fork.md +++ /dev/null @@ -1,23 +0,0 @@ -# Private Solidus fork - -If your store requires deep customizations to Solidus's core functionality, you -may want to fork Solidus for your store where you can more freely implement your -features. - -Note that this can complicate your Solidus upgrade process or can break other -Solidus extensions you may wish to use. - -The benefit of a private fork is that you can test your new features with -Solidus's test suite and ensure your development has not broken Solidus's -existing functionality. - -You can reference a private fork of Solidus in your `Gemfile` this way: - -```ruby -gem 'solidus', git: 'https://github.com/my_account/solidus.git', branch: "my-new-feature" -``` - -If you think your feature (or fix) if of interest to the wider Solidus -community, [consider making a pull request][contributing]. - -[contributing]: https://github.com/solidusio/solidus/blob/master/CONTRIBUTING.md diff --git a/guides/preferences/add-model-preferences.md b/guides/preferences/add-model-preferences.md index 8d4099be2c7..a7080c71dc3 100644 --- a/guides/preferences/add-model-preferences.md +++ b/guides/preferences/add-model-preferences.md @@ -45,8 +45,30 @@ types are: An optional default value may be defined. (See the `:dark_chocolate` preference in the block above.) This is the value used unless another value has been set. -Once you have set preferences, you can access their values from the object -they're set on: +### Add columns for your preferences + +In order for your new preferences to persist, you need to add a column to the +relevant model using a migration: + +```ruby +class AddPreferencesToSubscriptionRules < ActiveRecord::Migration[5.0] + def change + add_column :my_store_subscription_rules, :preferences, :text + end +end +``` + +Your new `preferences` column should be the type `text`. + +Then, you can run the migration: + +```shell +bundle exec rails db:migrate +``` + +### Access your preferences + +Now you can access their values from the model they are set on: ```ruby MyStore::SubscriptionRules.find(1).preferences diff --git a/guides/preferences/app-configuration.md b/guides/preferences/app-configuration.md index e8af58e5181..a0a845555be 100644 --- a/guides/preferences/app-configuration.md +++ b/guides/preferences/app-configuration.md @@ -1,10 +1,11 @@ -# App configuration +# App configuration Solidus includes many preferences with default settings that are appropriate for -typical stores. For a list of Solidus's preferences their default values, see -the [`Spree::AppConfiguration` documentation][app-configuration-documentation]. -The [`Spree::AppConfiguration` class][app-configuration-class] is where all of -Solidus's preferences are defined. +typical stores. For a list of Solidus's preferences and their default values, +see the [`Spree::AppConfiguration` +documentation][app-configuration-documentation]. The [`Spree::AppConfiguration` +class][app-configuration-class] is where all of Solidus's preferences are +defined. The built-in preferences are well-tested options that allow you to implement complex ecommerce behaviors. @@ -18,7 +19,7 @@ initializers. Some default preferences are explicitly set in the initializer at `config/initializers/spree.rb`. In this file's first `Spree.config` block, the `currency` and `mails_from` -preferences are given default values you may want to modify: +preferences are given default values you may want to modify: ```ruby # /config/initializers/spree.rb @@ -67,4 +68,3 @@ Spree::Config.currency [app-configuration-model]: https://github.com/solidusio/solidus/blob/master/core/lib/spree/app_configuration.rb [app-configuration-documentation]: http://docs.solidus.io/Spree/AppConfiguration.html [rails-engines]: http://guides.rubyonrails.org/engines.html -