diff --git a/app/models/usuarie.rb b/app/models/usuarie.rb index b9d9bf90..90e86510 100644 --- a/app/models/usuarie.rb +++ b/app/models/usuarie.rb @@ -13,7 +13,8 @@ class Usuarie < ApplicationRecord has_many :roles has_many :sites, through: :roles - after_create :register_in_lounge!, if: Rails.env.production? + before_create :register_in_lounge!, + if: proc { Rails.env.production? } def name email.split('@', 2).first diff --git a/test/models/post_test.rb b/test/models/post_test.rb index d437a30a..ed15f0a2 100644 --- a/test/models/post_test.rb +++ b/test/models/post_test.rb @@ -126,7 +126,7 @@ class PostTest < ActiveSupport::TestCase end test 'al cambiar slug o fecha cambia el archivo de ubicacion' do - hoy = 2.days.ago.to_time + hoy = 2.days.from_now.to_time path_was = @post.path.absolute @post.slug.value = 'test' @post.date.value = hoy