OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/models/cost_query.rb

39 lines
786 B

require_dependency "entry"
class CostQuery < ActiveRecord::Base
#belongs_to :user
#belongs_to :project
#attr_protected :user_id, :project_id, :created_at, :updated_at
def self.accepted_properties
@accepted_properties ||= []
end
def results
chain.results
end
def add_chain(type, name, options)
chain type.const_get(name.to_s.camelcase), options
end
def chain(klass = nil, options = {})
@chain ||= Filter::NoFilter.new
@chain = klass.new @chain, options if klass
@chain = @chain.parent until @chain.top?
@chain
end
def filter(name, options = {})
add_chain Filter, name, options
end
def group_by(name, options = {})
add_chain GroupBy, name, options
end
def method_missing(*a, &b)
chain.send(*a, &b)
end
end