From 3b58a009739336910bea783b8d008ddf5cef5a30 Mon Sep 17 00:00:00 2001 From: DmitryTsepelev Date: Fri, 15 Mar 2019 19:06:03 +0300 Subject: [PATCH] Make Rails4 #size play nice with #with_log_data --- lib/logidze/ignore_log_data.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/logidze/ignore_log_data.rb b/lib/logidze/ignore_log_data.rb index c8899d2a..068ac653 100644 --- a/lib/logidze/ignore_log_data.rb +++ b/lib/logidze/ignore_log_data.rb @@ -24,7 +24,13 @@ module IgnoreLogData # :nodoc: self.ignored_columns += ["log_data"] - scope :with_log_data, -> { select(column_names + ["log_data"]) } + scope :with_log_data, lambda { + if ignored_columns == ["log_data"] + select("*") + else + select(column_names + ["log_data"]) + end + } end module ClassMethods # :nodoc: