Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Category < ActiveRecord::Base
- validates_presence_of :name
- has_many :feeds, :dependent => :delete_all
- def stories(options = {})
- foo = id
- Story.instance_eval do
- with_scope(:find => options) do
- find :all, :joins => :feed,
- :conditions => [ 'feeds.category_id = ?', foo ]
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment