An example feature implementation in ruby on rails: capability to delete leadsets

Read this article in:

Hello everyone. In this episode, I will walk you through a tiny feature implementation in a ruby on rails engine (aka gem or library). This is a part of the Annesque email suite - you can read more on the project homepage. 

A leadset is a "company". I named it that for two reasons: first, to have a better singular/plural forms for automation. The plural of "company" is not "companys", so I'd have to either make sure the inflector works, or not rely on the word. And second, the words "lead" and "leadset" are very close alphabetically, allowing me to not spend time looking for related things all over the place. Note that "leadset" is one word, not two words. This is not english, this is ruby on rails. I created a new word, and it is serving me well.

This feature implements leadset deletion. Until now I did not have a way to delete leadsets.

You will say: what do you mean, you've spent all this time not deleting leadsets? The answer is: Yes. I have not needed to delete them for privacy or any other reason, and since contact info is valuable, deletion of such data was not implemented. I could label them as "trash", which is not the same as deleting. However, now in the process of combating spam, I've found it useful to delete leadsets that are truly useless. On to the implementation:

easy implementation

Bam, very easy. I see that deletion was half-implemented before, but it looks AI-written, undested and unused. I've also written a test of this implementation: 

test of implementation

Deployment automation still works, and was a single push-button command. The outcome is, the user interface now has this button:

the UI change

I didn't write a ticket for this task, since it was so small and historically tickets actually have not helped me create functionality any faster.

This concludes the quick task of adding a button to a UI.

Please login to post comments: