Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 403 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 403 Bytes

A very simple gem. This allows you to use the following code in ActiveRecord.

class PlanSku < ActiveRecord::Base
	belongs_to :sku
	belongs_to :plan_cost
	belogns_to :plan_coverage

	build_associated :sku
	build_associated :plan_cost
	build_associated :plan_coverage
end

plan = PlanSku.new
plan.sku # Instead of nil, it now returns PlanSku.build_sku

Tested on Rails3.1. Use at own risk.