Module: ActiverecordUtilities

Extended by:
ActiveSupport::Concern
Included in:
ApplicationRecord
Defined in:
lib/activerecord_utilities.rb

Overview

Shared ApplicationRecord utilities, like string manipulation methods. See app/models/application_record.rb for inclusion.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Object) trim_attributes (protected)



25
26
27
28
29
30
31
# File 'lib/activerecord_utilities.rb', line 25

def trim_attributes
  if !self.attributes_to_trim.nil?
    self.attributes_to_trim.each do |a|
      self.send("#{a}=".to_sym, Utilities::Strings.nil_strip(self.send(a)))
    end
  end
end