Sha256: 257b31dbe31647807ac6a2d2a78726a1f725d7869c05aa5e379354b937708790

Contents?: true

Size: 290 Bytes

Versions: 4

Compression:

Stored size: 290 Bytes

Contents

module RailsSettings
  module Fields
    class Boolean < ::RailsSettings::Fields::Base
      def deserialize(value)
        return nil if value.nil?

        ["true", "1", 1, true].include?(value)
      end

      def serialize(value)
        deserialize(value)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails-settings-cached-2.9.5 lib/rails-settings/fields/boolean.rb
rails-settings-cached-2.9.4 lib/rails-settings/fields/boolean.rb
rails-settings-cached-2.9.3 lib/rails-settings/fields/boolean.rb
rails-settings-cached-2.9.2 lib/rails-settings/fields/boolean.rb