RokkinCat/rokkincrm — pull request #10 by nickgartmann (2014-04-30 14:23:05+00:00)
Title: Added regex rules for ignoring messages

Added a table for storing regex rules for ignoring emails. This is a straight ruby regex and right now relies on us manually inserting into the database the rules we want.

It stores the rules table in memory on first usage on the Message class so that we aren't hitting the database for it all of the time. This wont scale indefinitely into the future, but it will work for smallish numbers of users. We can probably push this off to a memory cache too (redis or memcached) to make it scale a bit better.

I also didn't create a model for these... not 100% sure if I like that so I'd appreciate opinions on that. It might be better to pull them in from a literal file, but then we have to add rules to the file during usage, so thats not great either.

**If we accept this PR we should also create an enhancement issue for a UI for rule creation**