Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Curator at RICON 2012

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Curator at RICON 2012

Avatar for John Downey

John Downey

October 10, 2012

More Decks by John Downey

Other Decks in Programming

Transcript

  1. class Person include Curator::Model attr_accessor :id, :age def name if

    @name @name else "#{@first_name} #{@last_name}" end end end
  2. # db/migrate/people/0001_consolidate_name.rb class ConsolidateName < Curator::Migration def migrate(attributes) first_name =

    attributes.delete(:first_name) last_name = attributes.delete(:last_name) attributes.merge(:name => "#{first_name} #{last_name}") end end