-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix accepts_nested_attributes_for is triggering db connection in rail…
…s 7.2. add single types/base.
- Loading branch information
Mikhail Varabyou
committed
Nov 21, 2024
1 parent
c39579b
commit cbd2819
Showing
6 changed files
with
56 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
require "active_model" | ||
|
||
module StoreModel | ||
module Types | ||
# Base type for StoreModel::Model | ||
class Base < ActiveModel::Type::Value | ||
attr_reader :model_klass | ||
|
||
# Returns type | ||
# | ||
# @return [Symbol] | ||
def type | ||
raise NotImplementedError | ||
end | ||
|
||
protected | ||
|
||
def raise_cast_error(_value) | ||
raise NotImplementedError | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters