No commit activity in last 3 years
No release in over 3 years
Have ActiveRecord automagically build an association when accessed. Useful for belongs_to associations which should never be nil.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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.