Auto naming of Transfer Transaction#1393
Conversation
app/models/account/entry.rb
Outdated
|
|
||
| def assign_transfer_name | ||
| self.name = transfer.name | ||
| end |
There was a problem hiding this comment.
I think we should move this logic directly to the transfers controller:
Furthermore, it may be a nice touch if we had generated names for each of the entries within the transfer:
maybe/app/models/account/transfer.rb
Lines 46 to 64 in 490f445
For example, the "from" name could be something like "Transfer to #{to_account.name}" and the "to" name could be "Transfer from #{from_account.name}"
There was a problem hiding this comment.
Yes , This makes sense.
I believe if we’re assigning distinct names to both entries, then the name parameter in build_from_accounts function would be of no use, so removing it seems like the right approach to me
Also, Are we going to store the full name i.e Transfer from {from account} to {to account} elsewhere or this will going to be generated at runtime, like we do now.
There was a problem hiding this comment.
Also, I've noticed that locales are already used in the project, so directly adding "Transfer to #{to_account.name}" might not be ideal. Would it be better to create a locale attribute under the entry folder in en.yml, or would that be overkill for this change?
There was a problem hiding this comment.
@Harry-kp regarding locales, we're going to have to go back through a lot of the model stuff and make bulk updates once we start down the path of #1225 , so for this change, let's just hardcode it for now.
And in regards to the name: param, fully agree.
Are we going to store the full name i.e Transfer from {from account} to {to account} elsewhere
That's my bad, I forgot that Transfer does not have a stored name field. We can just keep generating at runtime as we're doing now.
Why?
What?
Transfer from {from_account} to {to_account}.Earlier it was saved asTransfer from Originator to Receiveror whatever user inputs in the Transfer form.Probable Concerns
Screen.Recording.2024-10-30.at.4.29.50.PM.mov