lib/ledger_sync/domains/operation/transition.rb in ledger_sync-domains-1.0.2 vs lib/ledger_sync/domains/operation/transition.rb in ledger_sync-domains-1.0.3

- old
+ new

@@ -12,10 +12,11 @@ required(:model_name).filled(:string) required(:id).filled(:integer) required(:event).value(:string) required(:attrs).maybe(:hash) required(:attrs).maybe(:array) + required(:limit).value(:hash) end end private @@ -39,10 +40,10 @@ def event_method "#{params[:event]}!" end def resource - @resource ||= resource_class.find_by(id: params[:id]) + @resource ||= resource_class.where(params[:limit]).find_by(id: params[:id]) end def resource_class @resource_class ||= Object.const_get(params[:model_name]) end