Advanced Rails

Relationships

  • has_one, belongs_to, has_many, habtm
  • generated methods
  • relationship options
  • :through and polymorphic relationships
  • acts_as_list, acts_as_tree
  • when instances get saved

Advanced AR

  • single table inheritance
  • polymorphic relationships
  • using multiple databases
  • transactions
  • named scopes

Better Testing

  • improving scaffold tests
  • assert_select
  • testing sad paths
  • rcov
  • test isolation
  • mocks and stubs

RSpec on AAA

  • from tests to specs
  • installing rspec
  • basic spec syntax
  • shared behaviors
  • pending behaviors
  • output options

Plugin

  • generating a plugin
  • plugin directory structure
  • extending existing classes
  • init.rb
  • install.rb
  • testing your plugin
  • contributing plugins

Wrapping Methods

  • aspect-oriented programming
  • technique 1: alias
  • technique 2: alias_method_chain
  • technique 3: unbound_method
  • technique 4: adding Module#wrap_method

DSLs

Complex DB

  • legacy data schema
  • unconventional table names
  • unconventional column names
  • unconventional foreign key names
  • alias_attribute
  • fixtures for complex schemas
  • migrations for complex schemas

Ajax Comments

Forms

  • DRYing up forms
  • custom form helpers
  • rspec view testing
  • custom form builders
  • adding a helper to all views

Inflector

  • singularize and pluralize
  • Ruby names
  • SQL names
  • human names
  • customizing inflections

RESTful resources

Tarantula

  • installing Tarantula
  • detecting security flaws
  • detecting HTTP and HTML errors
  • configuring Tarantula login

Caching

  • page caching
  • action caching
  • fragment caching
  • query caching
  • profiling
  • benchmarking
  • log analysis