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

America's Next Top Engineer

Aaron Patterson
June 07, 2013
2k

America's Next Top Engineer

Presentation popularity at RedDot RubyConf

Aaron Patterson

June 07, 2013
Tweet

Transcript

  1. Your Guide to
    Presentation
    Popularity!

    View Slide

  2. Your Guide to
    Presentation
    Notoriety!

    View Slide

  3. View Slide

  4. •Provocative Title
    •Risqué Photos
    •Ruby Code?

    View Slide

  5. Provocative Title:

    View Slide

  6. Use Ruby 1.9 like an
    Engineer

    View Slide

  7. Use Ruby 1.9 like a
    SEXY Engineer

    View Slide

  8. Risqué Photos

    View Slide

  9. America's Next Top
    Model

    View Slide

  10. America's Next Top
    Engineer

    View Slide

  11. Confident

    View Slide

  12. Elegant

    View Slide

  13. Sultry

    View Slide

  14. Sexy

    View Slide

  15. Thoughtful

    View Slide

  16. Fierce

    View Slide

  17. Playful

    View Slide

  18. Powerful

    View Slide

  19. Provocative

    View Slide

  20. Ruby Code?

    View Slide

  21. protected
    def method_missing(method, *args, &block)
    if Array.method_defined?(method)
    to_a.send(method, *args, &block)
    elsif @klass.scopes[method]
    merge(@klass.send(method, *args, &block))
    elsif @klass.respond_to?(method)
    scoping { @klass.send(method, *args, &block) }
    elsif arel.respond_to?(method)
    arel.send(method, *args, &block)
    elsif match = DynamicFinderMatch.match(method)
    attributes = match.attribute_names
    super unless @klass.send(:all_attributes_exists?, attributes)
    if match.finder?
    find_by_attributes(match, attributes, *args)
    elsif match.instantiator?
    find_or_instantiator_by_attributes(match, attributes, *args, &block)
    end
    else
    super
    end
    end
    private
    def references_eager_loaded_tables?
    # always convert table names to downcase as in Oracle quoted table names are in uppercase
    joined_tables = (tables_in_string(arel.joins(arel)) + [table.name, table.table_alias]).compact.map{ |t|
    t.downcase }.uniq
    (tables_in_string(to_sql) - joined_tables).any?
    end

    View Slide

  22. TL;DR

    View Slide