From 51685f651c2eac62ece7e0e7d7129a231bce9ff6 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Mon, 23 Sep 2013 15:28:48 -0300 Subject: [PATCH] Alias enterprise methods --- app/models/product.rb | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/app/models/product.rb b/app/models/product.rb index 62e8622..b00b6dc 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -17,6 +17,9 @@ class Product < ActiveRecord::Base belongs_to :enterprise, :foreign_key => :profile_id, :class_name => 'Profile' belongs_to :profile + alias_method :enterprise=, :profile= + alias_method :enterprise, :profile + has_one :region, :through => :enterprise validates_presence_of :enterprise -- libgit2 0.21.2