Sha256: 59b1d6618d8d9c49f986e07db4089c661b408e3e46258d40807f1953df746a3e
Contents?: true
Size: 682 Bytes
Versions: 8
Compression:
Stored size: 682 Bytes
Contents
module Product::ProjectManagement extend ActiveSupport::Concern included do has_many :stories, dependent: :nullify end module ClassMethods def stories(id, user) collection = if id == 'no-name' Story.where(_type: 'Story') else product = Product.find(id) begin product.story_class.for_user(user) rescue NotImplementedError product.story_class end end collection.where(:users_without_tasks_ids.ne => user.id) end end def projects; Project.where(product_id: id); end def story_class; "#{self.class.name}::Story".constantize rescue Story; end end
Version data entries
8 entries across 8 versions & 1 rubygems