search for: meter_group_id

Displaying 1 result from an estimated 1 matches for "meter_group_id".

2010 Aug 18
6
Once I added this HABTM, one of my 'through' relationships, on a non-habtm model, seems to have broke?
...ally I was only allowing a single meter to belong to only one meter_group and the following test and relationship of a Subscription worked fine: class Subscription < ActiveRecord::Base belongs_to :user, :foreign_key => "user_id" belongs_to :meter_group, :foreign_key => "meter_group_id" has_many :meters, :through => :meter_group end test "group1 and group2 belong to rachel" do user = User.find_by_login("rachel") subscriptions = Subscription.find_all_by_user_id(user.id) subscriptions.each do |s| meters = s.meters meters.each d...