Skip to content

Commit 2cb4532

Browse files
committed
Rename Scalient::Modeling::PolymorphicBuilder to Scalient::ActiveRecord::PolymorphicBuilder
1 parent d08ea32 commit 2cb4532

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/models/concerns/scalient/modeling/polymorphic_builder.rb renamed to app/models/concerns/scalient/active_record/polymorphic_builder.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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
@@ -16,7 +15,7 @@
1615
# the License.
1716

1817
module 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)

0 commit comments

Comments
 (0)