Say I have in Rails 3.1:
class Category < ActiveRecord::Base
has_many :items
end
class Item < ActiveRecord::Base
belongs_to :category
end
I’d like to do something
cat=Category.find(1)
cat.items.is_enabled=true
cat.save
but can’t and need to set each via a loop. Is there some way to just set these all at once?
thx
try