title: Rails trying to call controller method from console
body: <p>I'm trying to create a cron job using the whenever gem to send birthday reminders to users and i want this cron to run everyday.</p>
  
  <p>I have the whenever gem working, but my cron job keeps erroring out. I'm trying to call a controller method in the rails console to figure it out, but i keep getting errors and i'm unsure why.</p>
  
  <p>I have this controller:</p>
  
  <pre><code>class BirthdayRemindersController &lt; ApplicationController
  
      include ApplicationHelper
  
      # cron job that sends birthday reminders
      def send_birthday_email_reminders 
          users = User.all
  
          email_addresses = []
  
          users.each_with_index do |user, i|
              if user.user_details.birthday_reminders == true
                  email_addresses[i] = get_primary_email(user)
              end
          end
  
          p email_addresses
  
          users.each do |user|
              if user.user_details.birthday == Date.today
                  p "reminder sent"
                  send_birthday_reminders(user, email_addresses)      
              end
          end
      end
  end
  </code></pre>
  
  <p>And in the rails console i've tried both of these and they both error out. </p>
  
  <pre><code>Toms-Mac-mini:famnfo TomCaflisch$ rails c
  Loading development environment (Rails 3.2.9)
  irb(main):001:0&gt; BirthdayRemindersController.send_birthday_email_reminders
  NoMethodError: undefined method `send_birthday_email_reminders' for BirthdayRemindersController:Class
          from (irb):1
          from /Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@famnfo/gems/railties-3.2.9/lib/rails/commands/console.rb:47:in `start'
          from /Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@famnfo/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `start'
          from /Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@famnfo/gems/railties-3.2.9/lib/rails/commands.rb:41:in `&lt;top (required)&gt;'
          from script/rails:6:in `require'
          from script/rails:6:in `&lt;main&gt;'
  irb(main):002:0&gt; BirthdayReminders.send_birthday_email_reminders
  NameError: uninitialized constant BirthdayReminders
          from (irb):2
          from /Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@famnfo/gems/railties-3.2.9/lib/rails/commands/console.rb:47:in `start'
          from /Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@famnfo/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `start'
          from /Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@famnfo/gems/railties-3.2.9/lib/rails/commands.rb:41:in `&lt;top (required)&gt;'
          from script/rails:6:in `require'
          from script/rails:6:in `&lt;main&gt;'
  irb(main):003:0&gt; 
  </code></pre>
  
  <p>What am i missing? I have no routes defined for this controller because i don't want anyone to be able to hit it via a web brows</p>