lib/thoth/rails/model.rb in thoth-1.0.0 vs lib/thoth/rails/model.rb in thoth-1.0.1
- old
+ new
@@ -28,14 +28,14 @@
end
def thoth_log_update
return unless self.class.thoth_options[:on].include?(:update)
- if except_options.present?
- except_options = self.class.thoth_options[:except]
- only_options = self.class.columns.map(&:name) - except_options
+ except_options = self.class.thoth_options[:except]
+ only_options = if except_options.present?
+ self.class.columns.map(&:name) - except_options.map(&:to_s)
else
- only_options = self.class.thoth_options[:only]
+ self.class.thoth_options[:only]
end
if only_options.empty? || !(only_options.map(&:to_s) & changes.keys).empty?
thoth_log_model(:update)
end