Forum: Ruby on Rails Mail filters like functionality in Ruby on Rails

4158bee25c99e16bd978fc737adbc95e?d=identicon&s=25 Shan Kris (shanmugamk)
on 2010-12-09 14:59
For my new project, I need a functionality like mail filters. There will
be a set of rules with associated actions. When an user submits a
request, it needs to be passed through these rules for filtering. In
case any one of these rules matches, the corresponding action should be
triggered (the model will be updated with a few more attributes or an
email will be to a few people etc.,). Just like mail filters.

And, these rules will be user specific and stored as ActiveRecord
models.

Any pointers for existing gems?!

My ROR version is 2.3.8

P.S :- This will be more of business rules. For ex.,
In a CRM application, if the request is from a particular company or for
a particular product or based on timezone etc., assign to this group,
set it to high priority etc.,
Dd2d775dea75b381edb1bbf0600a0907?d=identicon&s=25 Marnen Laibow-Koser (marnen)
on 2010-12-09 15:58
Shan Kris wrote in post #967422:
> For my new project, I need a functionality like mail filters. There will
> be a set of rules with associated actions. When an user submits a
> request, it needs to be passed through these rules for filtering.

Will these requests be submitted as e-mail or through the Web interface?

> In
> case any one of these rules matches, the corresponding action should be
> triggered (the model will be updated with a few more attributes or an
> email will be to a few people etc.,). Just like mail filters.
>
> And, these rules will be user specific and stored as ActiveRecord
> models.
>
> Any pointers for existing gems?!

Do you need any?  This should be pretty easy to build: just make a bunch
of Filter objects and process them in some specified order.

If you need to track request state, acts_as_state_machine might help.

>
> My ROR version is 2.3.8

If this is a new project, as you say above, please start with the
current version of Rails, which is now 3.0.1.

>
> P.S :- This will be more of business rules. For ex.,
> In a CRM application, if the request is from a particular company or for
> a particular product or based on timezone etc., assign to this group,
> set it to high priority etc.,

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

Sent from my iPhone
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2010-12-09 18:36
(Received via mailing list)
On Thu, Dec 9, 2010 at 5:59 AM, Shan Kris <lists@ruby-forum.com> wrote:
> For my new project, I need a functionality like mail filters. There will
> be a set of rules with associated actions.

> P.S :- This will be more of business rules. For ex.,

I could have sworn I'd seen a Ruby version of Drools, but can't find it
now; in any case google `ruby rules engine` and you'll get some things
to check out  :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
4158bee25c99e16bd978fc737adbc95e?d=identicon&s=25 Shan Kris (shanmugamk)
on 2010-12-10 14:25
Hi Marnen,

1. These requests will be both e-mail and as well as requests through
web interface.

2. These filter objects are user/account based, so they need to be
persisted in database. Also, should be editable from UI.

3. I might not need state traversals. Act_as_state_machine is bit
advanced at this point of time.

Thanks for the response.

-Shan

Marnen Laibow-Koser wrote in post #967433:
> Shan Kris wrote in post #967422:
>> For my new project, I need a functionality like mail filters. There will
>> be a set of rules with associated actions. When an user submits a
>> request, it needs to be passed through these rules for filtering.
>
> Will these requests be submitted as e-mail or through the Web interface?
>
>> In
>> case any one of these rules matches, the corresponding action should be
>> triggered (the model will be updated with a few more attributes or an
>> email will be to a few people etc.,). Just like mail filters.
>>
>> And, these rules will be user specific and stored as ActiveRecord
>> models.
>>
>> Any pointers for existing gems?!
>
> Do you need any?  This should be pretty easy to build: just make a bunch
> of Filter objects and process them in some specified order.
>
> If you need to track request state, acts_as_state_machine might help.
>
>>
>> My ROR version is 2.3.8
>
> If this is a new project, as you say above, please start with the
> current version of Rails, which is now 3.0.1.
>
>>
>> P.S :- This will be more of business rules. For ex.,
>> In a CRM application, if the request is from a particular company or for
>> a particular product or based on timezone etc., assign to this group,
>> set it to high priority etc.,
>
> Best,
> -- 
> Marnen Laibow-Koser
> http://www.marnen.org
> marnen@marnen.org
>
> Sent from my iPhone
4158bee25c99e16bd978fc737adbc95e?d=identicon&s=25 Shan Kris (shanmugamk)
on 2010-12-10 14:27
Hi Hassan,

Earlier, I have tried searching both 'Ruby version of Drool' and 'Ruby
Rules Engine', didn't get exactly what I was looking for.

Thanks,
Shan

Hassan Schroeder wrote in post #967482:
> On Thu, Dec 9, 2010 at 5:59 AM, Shan Kris <lists@ruby-forum.com> wrote:
>> For my new project, I need a functionality like mail filters. There will
>> be a set of rules with associated actions.
>
>> P.S :- This will be more of business rules. For ex.,
>
> I could have sworn I'd seen a Ruby version of Drools, but can't find it
> now; in any case google `ruby rules engine` and you'll get some things
> to check out  :-)
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> twitter: @hassan
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.