Sha256: 8efe8f1be9179edf389bb67a714057df8e3ebb5b832434b80e2f7e209f566136

Contents?: true

Size: 204 Bytes

Versions: 18

Compression:

Stored size: 204 Bytes

Contents

module BetterRecord
  module NullifyBlankAttributes
    def write_attribute(attr_name, value)
      new_value = value == false ? false : value.presence
      super(attr_name, new_value)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
better_record-0.8.0 lib/better_record/nullify_blank_attributes.rb
better_record-0.7.5 lib/better_record/nullify_blank_attributes.rb
better_record-0.7.4 lib/better_record/nullify_blank_attributes.rb
better_record-0.7.3 lib/better_record/nullify_blank_attributes.rb
better_record-0.7.2 lib/better_record/nullify_blank_attributes.rb
better_record-0.7.1 lib/better_record/nullify_blank_attributes.rb
better_record-0.7.0 lib/better_record/nullify_blank_attributes.rb
better_record-0.6.1 lib/better_record/nullify_blank_attributes.rb
better_record-0.6.0 lib/better_record/nullify_blank_attributes.rb
better_record-0.5.5 lib/better_record/nullify_blank_attributes.rb
better_record-0.5.4 lib/better_record/nullify_blank_attributes.rb
better_record-0.5.1 lib/better_record/nullify_blank_attributes.rb
better_record-0.5.0 lib/better_record/nullify_blank_attributes.rb
better_record-0.4.0 lib/better_record/nullify_blank_attributes.rb
better_record-0.3.0 lib/better_record/nullify_blank_attributes.rb
better_record-0.2.0 lib/better_record/nullify_blank_attributes.rb
better_record-0.1.1 lib/better_record/nullify_blank_attributes.rb
better_record-0.1.0 lib/better_record/nullify_blank_attributes.rb