Permalink
Browse files

Fixed bug in migrations; Fixed UserMailer to use Configatron correctly.

  • Loading branch information...
1 parent 57b28f2 commit cecca9c4455d37f121a0df9c258cb2b845d4bf10 @ariejan ariejan committed Dec 22, 2008
Showing with 10 additions and 10 deletions.
  1. +8 −8 app/models/user_mailer.rb
  2. +1 −1 config/config.yml
  3. +1 −1 db/migrate/20081023115224_baseapp.rb
@@ -2,44 +2,44 @@ class UserMailer < ActionMailer::Base
def signup_notification(user)
setup_email(user)
@subject += 'Please activate your new account'
- @body[:url] = "http://#{Setting.get(:site_url)}/activate/#{user.activation_code}"
+ @body[:url] = "http://#{configatron.site_url}/activate/#{user.activation_code}"
end
def reset_password(user)
setup_email(user)
@subject += "Your password has been reset"
- @body[:url] = "http://#{Setting.get(:site_url)}/login"
+ @body[:url] = "http://#{configatron.site_url}/login"
end
def forgot_password(user)
setup_email(user)
@subject += "Forgotten password instructions"
- @body[:url] = "http://#{Setting.get(:site_url)}/users/reset_password/#{user.password_reset_code}"
+ @body[:url] = "http://#{configatron.site_url}/users/reset_password/#{user.password_reset_code}"
end
def forgot_login(user)
setup_email(user)
@subject += "Forgotten account login"
- @body[:url] = "http://#{Setting.get(:site_url)}/login"
+ @body[:url] = "http://#{configatron.site_url}/login"
end
def activation(user)
setup_email(user)
@subject += 'Your account has been activated!'
- @body[:url] = "http://#{Setting.get(:site_url)}/"
+ @body[:url] = "http://#{configatron.site_url}/"
end
protected
def setup_email(user)
@recipients = "#{user.email}"
- @from = "#{Setting.get(:support_name)} <#{Setting.get(:support_email)}>"
- @subject = "[#{Setting.get(:site_name)}] "
+ @from = "#{configatron.support_name} <#{configatron.support_email}>"
+ @subject = "[#{configatron.site_name}] "
@sent_on = Time.now
@body[:user] = user
# Get Settings
[:site_name, :company_name, :support_email, :support_name].each do |id|
- @body[id] = Setting.get(id)
+ @body[id] = configatron.send(id)
end
end
end
View
@@ -3,7 +3,7 @@
development: &local
site_name: BaseApp
- site_url: http://baseapp.local
+ site_url: baseapp.local
company_name: Kabisa ICT
admin_email: admin@test.com
@@ -24,7 +24,7 @@ def self.up
t.string :activation_code, :limit => 40
t.string :state, :null => :false, :default => 'passive'
t.datetime :remember_token_expires_at
- t.string :password_reset_cod, :default => nil
+ t.string :password_reset_code, :default => nil
t.datetime :activated_at
t.datetime :deleted_at
t.timestamps

0 comments on commit cecca9c

Please sign in to comment.