Skip to content

Instantly share code, notes, and snippets.

@Gregg
Last active December 13, 2015 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gregg/4979949 to your computer and use it in GitHub Desktop.
Save Gregg/4979949 to your computer and use it in GitHub Desktop.
Rails 4 Course Topics

Rails 4 Topics

Chapter 1

  • Ruby 1.9.3 and Whiny Nils.
  • ThreadSafety enabled in production.
  • Changes to match in routes.
  • Support for patch HTTP verb.
  • Route concerns

Chapter 2

  • Deprecation of Hash-based finders, like Post.find(:all)
  • Deprecation of dynamic finders that return collection, like Post.find_all_by_title('Rails 4').
  • Deprecation of dynamic finders that build or create objects, like Post.find_or_initialize_by_author('admin') and Post.find_or_create_by_author('admin').
  • New find_or_initialize_by, find_or_create_by and find_by.
  • New AR#update, AR#update_column and AR#update_columns methods.
  • ActiveRecord scopes must now take a callable object.
  • Deprecation of Model.scoped in favor of Model.all, which now returns a chainable object.
  • New Relation#load, Relation#none and Relation#not.
  • Changes to Relation#order.
  • New references method used when matching on attributes from eager loaded associations, like Post.includes(:comments).where("comments.name = 'foo'").references(:comments), and scenarios where references is not needed.
  • New ActiveMode::Model module.

Chapter 3

  • New Strong Parameters feature.
  • Authenticity token in remote forms now injected via JavaScript.
  • Custom handling for request_from_forgery.
  • New suffix for controller callbacks, like before_action :authenticate_user.
  • Custom Flash Types.
  • Encrypted Cookies.

Chapter 4

  • collection_check_boxes.
  • collection_radio_buttons.
  • date_select.
  • date_field.
  • Ruby template handler, example with returning JSON.

Chapter 5

  • New test folder structure.
  • New rake tasks for running tests.
  • Changes to performance testing.
  • Switch from TestUnit to MiniTest.

Chapter 6

  • Moved from memcache-client to dalli.
  • Controller wide etags.
  • New cache digests feature.

Chapter 7

  • ActionController::Live
  • Turbolinks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment