I have a method that i created called get_primary_email(user)
and it's in my application_controller.rb file.
Now i use this method in both my app, as well as a cron job that calls a method which uses get_primary_email(user)
My problem is, if i leave the method defined as this:
def get_primary_email(user)
end
It works just fine in my app, but the cron job errors out.
If i define the method as this:
def self.get_primary_email(user)
end
my cron job works, but every method that calls get_primary_email(user) through a browser fails.
How can i use this same method in both places?
EDIT
schedule.rb
set :output, "#{path}/log/cron.log"
every 1.day, :at => "8:00pm" do
runner "BirthdayRemindersController.send_birthday_email_reminders"
end