Sha256: 1b30603ce653fe425a4d3e74da9c52cd7f573c212926b606b64c6138dd72df91

Contents?: true

Size: 738 Bytes

Versions: 2

Compression:

Stored size: 738 Bytes

Contents

class WorksReportFilter < ReportFilter
  attr_reader :project_id
  attr_reader :invoice
  attr_reader :user_id
  
  def initialize(attributes)
    @project_id = nil
    @invoice = nil
    @user_id = nil

    if attributes
      attributes = attributes.clone
      
      project_id_param = attributes.delete(:project_id)
      @project_id = project_id_param.to_i if project_id_param && project_id_param.size > 0
      
      invoice_param = attributes.delete(:invoice)
      @invoice = invoice_param == 'true' if invoice_param && invoice_param.size > 0
      
      user_id_param = attributes.delete(:user_id)
      @user_id = user_id_param.to_i if user_id_param && user_id_param.size > 0
      
    end
    super(attributes)
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
backlog-0.37.2 app/models/works_report_filter.rb
backlog-0.37.1 app/models/works_report_filter.rb