diff --git a/app/models/user.rb b/app/models/user.rb index 6d08bef..575ab04 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -25,7 +25,7 @@ class User < ActiveRecord::Base if user.environment.nil? user.environment = Environment.default end - user.send(:make_activation_code) if !user.environment.enabled?('skip_new_user_email_confirmation') + user.send(:make_activation_code) unless user.environment.enabled?('skip_new_user_email_confirmation') end after_create do |user| diff --git a/db/migrate/20120813163139_set_activation_code_to_nil_if_already_activated.rb b/db/migrate/20120813163139_set_activation_code_to_nil_if_already_activated.rb index ed9591c..43feecb 100644 --- a/db/migrate/20120813163139_set_activation_code_to_nil_if_already_activated.rb +++ b/db/migrate/20120813163139_set_activation_code_to_nil_if_already_activated.rb @@ -1,6 +1,6 @@ class SetActivationCodeToNilIfAlreadyActivated < ActiveRecord::Migration def self.up - update("UPDATE users SET activation_code = ? WHERE activated_at IS NOT NULL") + update("UPDATE users SET activation_code = null WHERE activated_at IS NOT NULL") end def self.down diff --git a/db/schema.rb b/db/schema.rb index a683092..759728f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120411132751) do +ActiveRecord::Schema.define(:version => 20120813163139) do create_table "abuse_reports", :force => true do |t| t.integer "reporter_id" -- libgit2 0.21.2