Class: Refinery::RaceRegistrations::Registration

Inherits:
Core::BaseModel
  • Object
show all
Defined in:
app/models/refinery/race_registrations/registration.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.to_csv(options = {}) ⇒ Object



12
13
14
15
16
17
18
19
# File 'app/models/refinery/race_registrations/registration.rb', line 12

def self.to_csv(options = {})
  CSV.generate(options) do |csv|
    csv << column_names
    all.each do |product|
      csv << product.attributes.values_at(*column_names)
    end
  end
end

Instance Method Details

#to_paramObject



35
36
37
# File 'app/models/refinery/race_registrations/registration.rb', line 35

def to_param
  "#{id}-#{title.parameterize}"
end