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

  • Home
  • SEARCH
  • 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 6808669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:59:04+00:00 2026-05-26T19:59:04+00:00

I have been going over rails scheduling tasks options and stumbled upon this piece

  • 0

I have been going over rails scheduling tasks options and stumbled upon this piece of code from whenever.

case @environment
when 'production'
every 1.day, :at => "#{Time.parse('12:00 A').getlocal.strftime("%H:%M")}" do
   runner "Company.send_later(:create_daily_stories!)"
end 
when 'staging'
  every 15.minutes do
   command "thinking_sphinx_searchd  reindex"
  end
end

I am fairly new to ruby and I dont quite understand what “Company” here stands for. In other words say i want to send an email out to people and i have a controller class called email_controller in which I have a method called sendEmail and I want to send emails using this how would i do it? Should i say runner”email_controller.sendEmail” or something like that? I dont quite get it. Note – Do i use the model or controller in place of company?

  • 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-26T19:59:05+00:00Added an answer on May 26, 2026 at 7:59 pm

    In this case, Company is an example model that has a class/singleton method called create_daily_stories!. In theory, it would probably look like this:

    class Company < ActiveRecord::Base
    
      # Send out daily stories to all companies
      def self.create_daily_stories!
        # Do some stuff
      end
    end
    

    Ideally, generating emails resides in the business logic and should thusly be contained within a model (assuming you’re using an MVC framework like rails).

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

Sidebar

Related Questions

I have been going over python tutorials in this resource . Everything is pretty
I have been going over this for hours and cannot find the problem. I
I just joined a project, and have been going over the code. We need
I have been going crazy over this! I have an Air (2.6) app which,
I've switched over to a Mac recently and, although things have been going quite
I have been going through the core jQuery code and had a few why
I have been going over tutorials but i have hit some quesitons. when the
I have been going over the practicality of some of the new parallel features
This question is long winded because I have been updating the question over a
I have joined a rails project as a contractor. The project has been going

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.