Skip to content

Commit

Permalink
Update versioncake config
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Feb 26, 2016
1 parent 189b8f4 commit 9ac481c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions api/lib/spree/api/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ class Engine < Rails::Engine
config.json_engine = ActiveSupport::JSON
end

config.view_versions = [1]
config.view_version_extraction_strategy = :http_header

initializer "spree.api.environment", before: :load_config_initializers do |_app|
Spree::Api::Config = Spree::ApiConfiguration.new
end

initializer "spree.api.versioncake" do |_app|
VersionCake.setup do |config|
config.resources do |r|
r.resource %r{.*}, [], [], [1]
end
config.missing_version = 1
config.extraction_strategy = :http_header
end
end

def self.activate
Dir.glob(File.join(File.dirname(__FILE__), "../../../app/**/*_decorator*.rb")) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
Expand Down

0 comments on commit 9ac481c

Please sign in to comment.