Skip to content

Commit

Permalink
Merge pull request #23 from artofhuman/user_and_company
Browse files Browse the repository at this point in the history
feature: add methods to user processor from project
  • Loading branch information
artofhuman authored Oct 26, 2016
2 parents 8d4b341 + 8926025 commit 1cabacb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/treasury/processors/user/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
module Treasury
module Processors
module User
class Base < ::CoreDenormalization::Processors::User::Base
class Base < Treasury::Processors::Base
alias :user_id= :object=
alias :user_id :object

protected

def init_event_params
self.user_id = extract_user
raise ArgumentError, "User ID expected to be Integer, #{@event.inspect}" unless user_id
end

def extract_user
@event.raw_data[:user_id] || @event.raw_data[:id]
end
end
end
end
Expand Down

0 comments on commit 1cabacb

Please sign in to comment.