File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def children
5858 end
5959
6060 def resource_for_type ( type )
61- resource = children . find { |c | c . type == type }
61+ resource = children . find { |c | c . type . to_s == type . to_s }
6262 if resource . nil?
6363 raise Errors ::PolymorphicResourceChildNotFound . new ( self , type : type )
6464 else
Original file line number Diff line number Diff line change @@ -175,6 +175,20 @@ def self.name
175175
176176 expect ( instance . errors ) . to be_blank
177177 end
178+
179+ context "when updating" do
180+ before do
181+ payload [ "action" ] = "update"
182+ payload [ :data ] [ :id ] = 1
183+ payload [ :filter ] = { id : 1 }
184+ end
185+
186+ it "accepts the child type" do
187+ validate
188+
189+ expect ( instance . errors ) . to be_blank
190+ end
191+ end
178192 end
179193 end
180194
You can’t perform that action at this time.
0 commit comments