Sha256: 2257cc6d6d3a0f294850ed61462b033e372d05955f577a25e6d8ee8110507cc7
Contents?: true
Size: 555 Bytes
Versions: 5
Compression:
Stored size: 555 Bytes
Contents
module FlattenRecord module Meta class ComputeColumn < Column def initialize(parent, method, type, target_model, model, options={}) @column = Struct. new(:name, :default, :type, :null). new(method, options[:default], type, options[:null]) super(parent, @column, target_model, model) end def denormalize(instance, to_record) assign_value(to_record, name) do |record| record.send("compute_#{@column.name}".to_sym, instance) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems