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 full-size slide

  2. Your Guide to
    Presentation
    Notoriety!

    View full-size slide

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

    View full-size slide

  4. Provocative Title:

    View full-size slide

  5. Use Ruby 1.9 like an
    Engineer

    View full-size slide

  6. Use Ruby 1.9 like a
    SEXY Engineer

    View full-size slide

  7. Risqué Photos

    View full-size slide

  8. America's Next Top
    Model

    View full-size slide

  9. America's Next Top
    Engineer

    View full-size slide

  10. 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 full-size slide