Skip to content

Commit

Permalink
Merge pull request #14 from abak-press/master
Browse files Browse the repository at this point in the history
Merge branch 'master' into 'orders/release/20160303'
  • Loading branch information
dsalahutdinov committed Mar 15, 2016
2 parents 2841de0 + 0469324 commit 66403ad
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@

#### [Current]
* 2016-03-11 [644a080](../../commit/644a080) - __(Sergey Kucher)__ chore: move methods from plugin into gem for processors base - #object - #no_action https://jira.railsc.ru/browse/PC4-15968
* 2016-03-02 [2d4cf6f](../../commit/2d4cf6f) - __(Semyon Pupkov)__ chore: use spec_helper instead internal class

#### v0.1.0
* 2016-03-02 [c21355d](../../commit/c21355d) - __(Semyon Pupkov)__ Release 0.1.0
* 2016-03-01 [863782b](../../commit/863782b) - __(Sergey Kucher)__ fix: customer new orders counter - fix treasury/processors/counters module in case when nothing changing
* 2016-03-02 [07aac88](../../commit/07aac88) - __(Semyon Pupkov)__ feature: add helper for stub plugin into tests

#### v0.0.5
* 2016-03-02 [8475cac](../../commit/8475cac) - __(Salahutdinov Dmitry)__ Release 0.0.5
* 2016-03-01 [8375263](../../commit/8375263) - __(Semyon Pupkov)__ feature: add base field and translators

#### v0.0.4
Expand Down
6 changes: 6 additions & 0 deletions lib/treasury/processors/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
module Treasury
module Processors
class Base < ::CoreDenormalization::Processors::Base
attr_accessor :object

def current_value(field_name = nil)
object_value(@object, field_name)
end
Expand All @@ -24,6 +26,10 @@ def form_value(value)
def result_row(value)
{@object => form_value(value)}
end

def no_action
nil
end
end
end
end
65 changes: 65 additions & 0 deletions lib/treasury/spec_helpers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module Treasury
module CoreDenormalizationFake
ROOT_REDIS_KEY = 'denormalization'.freeze

module Processors
module Company
class Base
end
end

module User
class Base
def interesting_event?
true
end
end
end

class Base
end
end

module Fields
module User
class Base
end

class Companies
end
end

module Company
class Base
end

class Translator
end
end

class Base
end
end
end

# Treasury::SpecHelpers provides method for stub plugin denormalization classes
# with fake class.
#
# Example:
# spec_helper.rb
#
# require 'treasury/spec_helpers'
#
# Treasury::SpecHelpers.stub_core_denormalization
#
# RSpec.configure do |config|
# ...
# end
module SpecHelpers
def stub_core_denormalization
Object.const_set('CoreDenormalization', CoreDenormalizationFake)
end

module_function :stub_core_denormalization
end
end
2 changes: 1 addition & 1 deletion lib/treasury/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Treasury
VERSION = '0.0.5'
VERSION = '0.2.0'
end
6 changes: 0 additions & 6 deletions spec/internal/lib/core_denormalization/processors/base.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
require 'combustion'
Combustion.initialize!

require_relative 'internal/lib/core_denormalization/processors/base'
Treasury::SpecHelpers.stub_core_denormalization

0 comments on commit 66403ad

Please sign in to comment.