From f1026d0aca169caf57dd44e57661177bd66e2e37 Mon Sep 17 00:00:00 2001 From: Brendan G. Lim Date: Thu, 19 Jun 2008 02:17:08 -0400 Subject: Updating to be compatibile with Rails 2.1 --- lib/sms_fu.rb | 1 + lib/sms_notifier.rb | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/sms_fu.rb b/lib/sms_fu.rb index 4f77735..9533341 100644 --- a/lib/sms_fu.rb +++ b/lib/sms_fu.rb @@ -1,4 +1,5 @@ require 'yaml' +require 'sms_notifier' # Copyright (c) 2008 Brendan G. Lim (brendangl@gmail.com) # # Permission is hereby granted, free of charge, to any person obtaining diff --git a/lib/sms_notifier.rb b/lib/sms_notifier.rb index cf698c8..1dff814 100644 --- a/lib/sms_notifier.rb +++ b/lib/sms_notifier.rb @@ -33,8 +33,13 @@ class SmsNotifier < ActionMailer::Base body['message'] = message end - def template_root - "#{File.dirname(__FILE__)}/../views" + view_path = File.join(File.dirname(__FILE__), '..', 'views') + if public_methods.include?('append_view_path') + self.append_view_path view_path + elsif public_methods.include?("view_paths") + self.view_paths << view_path + else + self.template_root = view_path end end \ No newline at end of file -- cgit v1.2.3