ruby on rails - shortest way to get activerecord attributes from irb to excel sheet -
i'm pulling small statistics or bunch of product-data erp system irb-console excel. example product data:
product.where(active:true, sale:false).map{|p| [p.sku, p.name, p.stock_amount].join("\t")}.each{|s| puts s} the output can copied , pasted directly excel. shortest found self. there way less typing done?
what database using? databases postgresql have copy command allows export active record query filled data csv file can opened , resaved excel file. fastest , convenient way start work larger data-sets.
Comments
Post a Comment