Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a continuation of #245, addressing some snags I had using it to address a similar need (#245 (comment)). Thanks @jordan-allan for the great starting point.
The conflict between
Records#type
andInvoice.search_only_field :type
is now resolved and there's a check to ensure future conflicts between public/protected methods and fields aren't introduced. More on this is the commit message.The casing of the record type is also resolved to be lower camelcase instead of just lowercase.
Broadly I have some concerns about calling this action
attach_file
as NetSuite actually calls itattach
(with a correspondingdetach
) and can be used for both files and contacts as the thing being attached to another record. My immediate need was for attaching files and that aligned with @jordan-allan's work, so I stuck on that route. Thinking ahead, if we wanted to support attaching contacts, would we introduce a new actionattach_contact
, or would we renameattach_file
toattach
, leading to a breaking change/deprecation for anyone usingattach_file
? To support contacts, I believe the only thing that would have to change is where theattachedRecord
@type
is hardcoded to "file" to pull the type from the record itself (and rename the@file
variable accordingly).