Any ideas what it takes to get this to work? I can’t for the life of me figure it out.
def get_prices(c)
@print_prices = {}
Billing.where(:name => c).column_names.each do |d|
if d.match(/^print_/)
@print_prices[d] = d.value
end
end
return @print_prices
end
I’ve got no idea what to substitute d.value for.
Cheers for any help.
The following code will perform the query, returned in the form of a relation, and reject all items in the attribute key-value hash which do not match the given regex, which, in this case, is
/^print_/.Alternatively, it can also be written as: