From 47f828f38659f5a0b3f9844a4004c3e1abeb852c Mon Sep 17 00:00:00 2001 From: f Date: Thu, 12 Sep 2019 17:07:29 -0300 Subject: [PATCH] fixes --- app/models/usuarie.rb | 3 ++- test/models/post_test.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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