source
end
- # Generate the default Query
- def Query.generate_default!(attributes={})
- query = Query.new(attributes)
- query.name = '_' if query.name.blank?
- query.save!
- query
- end
-
# Generate an issue for a project, using it's trackers
def Issue.generate_for_project!(project, attributes={})
issue = Issue.new(attributes) do |issue|
@project = project
@gantt = Redmine::Helpers::Gantt.new(options)
@gantt.project = @project
- @gantt.query = Query.generate_default!(:project => @project)
+ @gantt.query = Query.create!(:project => @project, :name => 'Gantt')
@gantt.view = self
@gantt.instance_variable_set('@date_from', options[:date_from] || 2.weeks.ago.to_date)
@gantt.instance_variable_set('@date_to', options[:date_to] || 2.weeks.from_now.to_date)