Sha256: 32e6befe92515aade781fddf1f481a26141494e27649d88226994c57fbdc55c6

Contents?: true

Size: 578 Bytes

Versions: 2

Compression:

Stored size: 578 Bytes

Contents

class Puppet::Rails::ParamValue < ActiveRecord::Base
    belongs_to :param_name
    belongs_to :resource

    def value
        val = self[:value]
        if val =~ /^--- \!/
            YAML.load(val)
        else
            val
        end
    end

    # I could not find a cleaner way to handle making sure that resource references
    # were consistently serialized and deserialized.
    def value=(val)
        if val.is_a?(Puppet::Parser::Resource::Reference)
            self[:value] = YAML.dump(val)
        else
            self[:value] = val
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-0.24.0 lib/puppet/rails/param_value.rb
puppet-0.24.1 lib/puppet/rails/param_value.rb