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

Curator at RICON 2012

Curator at RICON 2012

John Downey

October 10, 2012
Tweet

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