Skip to content

Commit

Permalink
Merge branch 'hotfix/0.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Hallgren committed Mar 26, 2014
2 parents 5518c03 + 5127a78 commit ab1ebd7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
sandthorn (0.0.1)
sandthorn (0.0.2)
dirty_hashy

GEM
Expand Down
6 changes: 3 additions & 3 deletions lib/sandthorn/aggregate_root_base.rb
Expand Up @@ -30,9 +30,9 @@ def save
self
end

def commit *args
def commit *args, method_name: nil
increase_current_aggregate_version!
method_name = caller[0][/\`.*\'/][1..-2]
method_name = caller_locations(1,1)[0].label unless method_name
aggregate_attribute_deltas = get_delta

unless aggregate_attribute_deltas.empty?
Expand Down Expand Up @@ -82,7 +82,7 @@ def new *args
aggregate.aggregate_trace @@aggregate_trace_information do |aggr|
aggr.aggregate_initialize
aggr.send :set_aggregate_id, Sandthorn.generate_aggregate_id
aggr.send :commit, *args
aggr.send :commit, *args, method_name: "new"
return aggr
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sandthorn/version.rb
@@ -1,3 +1,3 @@
module Sandthorn
VERSION = "0.0.1"
VERSION = "0.0.2"
end
4 changes: 4 additions & 0 deletions spec/event_inspector_spec.rb
Expand Up @@ -52,6 +52,10 @@ module Sandthorn
context "with no tracing information" do
let(:subject) { aggregate.this_is_an_event;aggregate }

it "should have the new event" do
subject.has_event?(:new).should be_true
end

it "should report true on has_unsaved_event? :this_is_an_event" do
subject.has_unsaved_event?(:this_is_an_event).should be_true
end
Expand Down

0 comments on commit ab1ebd7

Please sign in to comment.