Commit 873120cefa81d0b94f22db7db142680da9a15c4b

Authored by Daniela Feitosa
1 parent 687f3e11

Added new db/schema.rb

Also replaced "if !" by "unless"
app/models/user.rb
@@ -25,7 +25,7 @@ class User < ActiveRecord::Base @@ -25,7 +25,7 @@ class User < ActiveRecord::Base
25 if user.environment.nil? 25 if user.environment.nil?
26 user.environment = Environment.default 26 user.environment = Environment.default
27 end 27 end
28 - user.send(:make_activation_code) if !user.environment.enabled?('skip_new_user_email_confirmation') 28 + user.send(:make_activation_code) unless user.environment.enabled?('skip_new_user_email_confirmation')
29 end 29 end
30 30
31 after_create do |user| 31 after_create do |user|
db/migrate/20120813163139_set_activation_code_to_nil_if_already_activated.rb
1 class SetActivationCodeToNilIfAlreadyActivated < ActiveRecord::Migration 1 class SetActivationCodeToNilIfAlreadyActivated < ActiveRecord::Migration
2 def self.up 2 def self.up
3 - update("UPDATE users SET activation_code = ? WHERE activated_at IS NOT NULL") 3 + update("UPDATE users SET activation_code = null WHERE activated_at IS NOT NULL")
4 end 4 end
5 5
6 def self.down 6 def self.down
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 # 9 #
10 # It's strongly recommended to check this file into your version control system. 10 # It's strongly recommended to check this file into your version control system.
11 11
12 -ActiveRecord::Schema.define(:version => 20120411132751) do 12 +ActiveRecord::Schema.define(:version => 20120813163139) do
13 13
14 create_table "abuse_reports", :force => true do |t| 14 create_table "abuse_reports", :force => true do |t|
15 t.integer "reporter_id" 15 t.integer "reporter_id"