File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
app/models/concerns/scalient/active_record Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- #
4- # Copyright 2021 Scalient LLC
3+ # Copyright 2021-2024 Scalient LLC
54#
65# Licensed under the Apache License, Version 2.0 (the "License"); you may not
76# use this file except in compliance with the License. You may obtain a copy of
1615# the License.
1716
1817module Scalient
19- module Modeling
18+ module ActiveRecord
2019 module PolymorphicBuilder
2120 extend ActiveSupport ::Concern
2221
@@ -42,8 +41,8 @@ def build_polymorphic(association_name)
4241 raise "Foreign class `#{ foreign_class } ` not found"
4342 end
4443
45- if id = params [ foreign_class . primary_key ]
46- if record = foreign_class . find_by_id ( id )
44+ if ( id = params [ foreign_class . primary_key ] )
45+ if ( record = foreign_class . find_by_id ( id ) )
4746 record
4847 else
4948 raise_nested_attributes_record_not_found! ( association_name , id )
You can’t perform that action at this time.
0 commit comments