Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6372937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:18:04+00:00 2026-05-25T01:18:04+00:00

I am looking for a Ruby/Rails tool that will help me accomplish the following:

  • 0

I am looking for a Ruby/Rails tool that will help me accomplish the following:

I would like to store the following string, and ones similar to it, in my database. When an object is created, updated, deleted, etc., I want to run through all the strings, check to see if the CRUD event matches the conditions of the string, and if so, run the actions specified.

When a new ticket is created and it's category=6 then notify user 1234 via email

I am planning to create an interface that builds these strings, so it doesn’t need to be a human-readable string. If a JSONish structure is better, or a tool has an existing language, that would be fantastic. I’m kinda thinking something along the lines of:

{
  object_types: ['ticket'],
  events: ['created', 'updated'],
  conditions:'ticket.category=6',
  actions: 'notify user',
  parameters: {
    user:1234,
    type:'email'
  }
}

So basically, I need the following:

  1. Monitor CRUD events – It would be nice if the tool had a way to do this, but Ican use Rails’ ModelObservers here if the tool doesn’t natively provide it

  2. Find all matching “rules” – This is my major unknown…

  3. Execute the requested method/parameters – Ideally, this would be defined in my Ruby code as classes/methods

Are there any existing tools that I should investigate?

Edit:

Thanks for the responses so far guys! I really appreciate you pointing me down the right paths.

The use case here is that we have many different clients, with many different business rules. For the rules that apply to all clients, I can easily create those in code (using something like Ruleby), but for all of the client-specific ones, I’d like to store them in the database. Ideally, the rule could be written once, stored either in the code, or in the DB, and then run (using something Resque for performance).

At this point, it looks like I’m going to have to roll my own, so any thoughts as to the best way to do that, or any tools I should investigate, would be greatly appreciated.

Thanks again!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:18:05+00:00Added an answer on May 25, 2026 at 1:18 am

    I don’t think it would be a major thing to write something yourself to do this, I don’t know of any gems which would do this (but it would be good if someone wrote one!)

    I would tackle the project in the following way, the way I am thinking is that you don’t want to do the rule matching at the point the user saves as it may take a while and could interrupt the user experience and/or slow up the server, so…

    1. Use observers to store a record each time a CRUD event happens, or to make things simpler use the Acts as Audited gem which does this for you.

    1.5. Use a rake task, running from your crontab to run through the latest changes, perhaps every minute, or you could use Resque which does a good job of handling lots of jobs

    1. Create a set of tables which define the possible rules a user could select from, perhaps something like

    Table: Rule

    Name

    ForEvent (eg. CRUD)

    TableInQuestion

    • FieldOneName

    • FieldOneCondition etc.

    MethodToExecute

    You can use a bit of metaprogramming to execute your method and since your method knows your table name and record id then this can be picked up.

    Additional Notes

    The best way to get going with this is to start simple then work upwards. To get the simple version working first I’d do the following …

    1. Install acts as audited
    2. Add an additional field to the created audit table, :when_processed
    3. Create yourself a module in your /lib folder called something like processrules which roughly does this

      3.1 Grabs all unprocessed audit entries
      3.2 Marks them as processed (perhaps make another small audit table at this point to record events happening)

    4. Now create a rules table which simply has a name and condition statement, perhaps add a few sample ones to get going

      Name: First | Rule Statement: ‘SELECT 1 WHERE table.value = something’

    5. Adapt your new processrules method to execute that sql for each changed entry (perhaps you want to restrict it to just the tables you are working with)

    6. If the rule matched, add it to your log file.

    From here you can extrapolate out the additional functionality you need and perhaps ask another question about the metaprogramaming side of dynamically calling methods as this question is quite broad, am more than happy to help further.

    I tend to think the best way to go about task processing is to setup the process nicely first so it will work with any server load and situation then plug in the custom bits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for a reporting gem or tool in ruby on rails. its
I'm looking at some ruby code in rails, which looks like: user.jobs.order('created_at').not_closed.page(5) In ActiveRecord::Base,
I am looking for the ruby/rails gem that deals with the Authentication API for
I'm looking for some blog that talks about ruby and rails. Any tips? Thanks
I am looking for something like Ruby on Rails, which is open source, has
I am looking at using Ruby on Rails for a storefront that has to
I am looking to create a file uploader using Ruby on Rails that must
I'm looking for a ruby gem (or rails plugin) which abstracts the details of
I'm looking at ways to deploy a Ruby on Rails app (running on JRuby)
I am looking for an upload solution for Ruby on Rails where I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.