Sha256: 17811d19d73f3e8f93a659996c55b3a325edf64e3b4f15ed979ccdee80cdc380

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 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

    def to_label
      "#{self.param_name.name}"
    end  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-0.24.2 lib/puppet/rails/param_value.rb
puppet-0.24.3 lib/puppet/rails/param_value.rb
puppet-0.24.4 lib/puppet/rails/param_value.rb
puppet-0.24.5 lib/puppet/rails/param_value.rb
puppet-0.24.7 lib/puppet/rails/param_value.rb
puppet-0.24.6 lib/puppet/rails/param_value.rb