I have the following

class Province < ActiveRecord::Base
  has_many  :cities
  attr_accessible :name, :is_active
end

class City < ActiveRecord::Base
  belongs_to  :province
  attr_accessible :name, :province_id, :is_active
end

now I want to get all the provinces with is_active = true which have
cities with is_active = true

please guide me on how this can be done.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to