Skip to content

Commit

Permalink
Make Rails4 #size play nice with #with_log_data
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryTsepelev authored and palkan committed May 15, 2019
1 parent 66eab23 commit 3b58a00
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/logidze/ignore_log_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3b58a00

Please sign in to comment.