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

ActiveRecord Internals - EmpanadaRecord - Medel...

ActiveRecord Internals - EmpanadaRecord - Medellin.rb

ActiveRecord Internals talk on Medellin.rb meetup http://www.meetup.com/medellin-rb/

Avatar for Oscar Rendón

Oscar Rendón

April 29, 2015
Tweet

More Decks by Oscar Rendón

Other Decks in Programming

Transcript

  1. Schedule - Say Hi - Active Record Pattern - ActiveRecord

    (Rails) - Yummy yummy - Code Kata @RubyMedellin http://medellinrb.org
  2. Active Record Pattern An object that wraps a row in

    a database table or view, encapsulates the database access, and adds domain logic on that data. http://www.martinfowler.com/eaaCatalog/activeRecord.html
  3. ActiveRecord (Rails) Active Record facilitates the creation and use of

    business objects whose data requires persistent storage to a database. It is an implementation of the Active Record pattern which itself is a description of an Object Relational Mapping system. http://guides.rubyonrails.org/active_record_basics.html
  4. ActiveRecord (Rails) - ActiveModel - Migrations - Adapters - Validations

    - Callbacks - etc http://guides.rubyonrails.org/active_record_basics.html
  5. ActiveRecord (Rails) class Product < ActiveRecord::Base # ... end Product.first

    Product.where(name: ‘LCD TV’) http://guides.rubyonrails.org class CreateProducts < ActiveRecord::Migration def change create_table :products do |t| t.string :name t.text :description t.timestamps null: false end end end
  6. Code Kata Kata (型 or 形 literally: "form"?), a Japanese

    word, are the detailed choreographed patterns of movements practised either solo or in pairs. A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition. http://en.wikipedia.org/wiki/Kata_(programming) - http://en.wikipedia.org/wiki/Kata