From e29f755cbc9518fd75841944b87c6f3bcc4098c5 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Sun, 10 Jan 2016 10:59:22 +0000 Subject: [PATCH] =?UTF-8?q?Rails'=20code=20reloading=20is=20crap=20=C2=AF\?= =?UTF-8?q?=5F(=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/decorators/helpers/avatar_helper.rb | 6 ++++++ config/environments/development.rb | 2 -- config/environments/production.rb | 2 -- config/environments/test.rb | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/decorators/helpers/avatar_helper.rb b/app/decorators/helpers/avatar_helper.rb index 25cab44..22e080f 100644 --- a/app/decorators/helpers/avatar_helper.rb +++ b/app/decorators/helpers/avatar_helper.rb @@ -19,4 +19,10 @@ module AvatarHelper end end + if Rails.env.test? + include TestAvatarURL + else + include GravatarURL + end + end diff --git a/config/environments/development.rb b/config/environments/development.rb index fc8a31c..ddf0e90 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -35,5 +35,3 @@ Rails.application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true end - -AvatarHelper.send(:include, AvatarHelper::GravatarURL) diff --git a/config/environments/production.rb b/config/environments/production.rb index 7228193..8d3f99a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -76,5 +76,3 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false end - -AvatarHelper.send(:include, AvatarHelper::GravatarURL) diff --git a/config/environments/test.rb b/config/environments/test.rb index 801d031..6bbe9c4 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -37,5 +37,3 @@ Rails.application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true end - -AvatarHelper.send(:include, AvatarHelper::TestAvatarURL)