Displaying 1 result from an estimated 1 matches for "itemtop".
2008 Jul 12
3
calculations on nested resources
...oblem.
I have 3 resources that are all bound to eachother like this:
class Item < ActiveRecord::Base
belongs_to :item_category
// has a date and amount attr
end
class ItemCategory < ActiveRecord::Base
has_many :items
has_many :item_tops
// groups the items in categories
end
class ItemTop < ActiveRecord::Base
belongs_to :item_category
// has a start and stop date and an amount attr
end
The thing I would like to do now starts from the ItemTop resource. When
I do a search, it will search for all ItemTop resources where the start
and stop dates are between or equal to 2 dates t...