Sha256: 419c332f06f45f011d703272a964dc1f7335272266a8cd18caf1393c8cc46566

Contents?: true

Size: 321 Bytes

Versions: 5

Compression:

Stored size: 321 Bytes

Contents

class Person < ActiveRecord::Base
  validates_presence_of :first_name, :last_name
  has_many :cats

  def full_name
    "#{ first_name} #{ last_name }"
  end

  class << self
    def csv_header
      [human_attribute_name(:id), human_attribute_name(:full_name)]
    end
  end

  def csv_row
    [id, full_name]
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_csv_renderer-0.2.4 spec/support/person.rb
rails_csv_renderer-0.2.3 spec/support/person.rb
rails_csv_renderer-0.2.2 spec/support/person.rb
rails_csv_renderer-0.2.1 spec/support/person.rb
rails_csv_renderer-0.1.0 spec/support/person.rb