Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Github are assholes :)

  • Loading branch information...
commit 4203f0b058748f52c8f1c2436622dab3acc3e0c3 1 parent 24ca555
@eladmeidar authored
Showing with 7,733 additions and 11,096 deletions.
  1. +132 −189 _site/2007/03/consult-the-console-2/index.html
  2. +131 −188 _site/2007/03/the-boolean-connection-2/index.html
  3. +131 −188 _site/2007/03/the-chronic-files-2/index.html
  4. +131 −188 _site/2007/04/counter_cache-2/index.html
  5. +131 −188 _site/2007/08/connection-options-2/index.html
  6. +131 −188 _site/2007/08/customize-logger-message-format-2/index.html
  7. +131 −188 _site/2007/08/dynamically-adding-methods-2/index.html
  8. +131 −188 _site/2007/08/mean-mail-machine-2/index.html
  9. +131 −188 _site/2007/08/seeking-alpha-2-0-launch-successful-2/index.html
  10. +131 −188 _site/2007/08/using-your-gmail-as-actionmailer-carrier-2/index.html
  11. +131 −188 _site/2007/08/webistrano-capistrano-deployment-the-easy-way-2/index.html
  12. +131 −188 _site/2007/09/add-custom-operators-in-ruby-2/index.html
  13. +132 −189 _site/2007/09/iphone-on-rails-2/index.html
  14. +131 −188 _site/2007/09/model-reflection-overview-2/index.html
  15. +131 −188 _site/2007/09/relative_time_helper-plugin-2/index.html
  16. +131 −188 _site/2007/09/setting-up-logger-options-2/index.html
  17. +131 −188 _site/2007/09/the-running-program-2/index.html
  18. +131 −188 _site/2007/09/unique-insertion-into-array-2/index.html
  19. +131 −188 _site/2007/09/wymeditor-standards-driven-wysiwyg-editor-2/index.html
  20. +131 −188 _site/2008/01/not-proxy-for-ruby-2/index.html
  21. +131 −188 _site/2008/01/ruby-debug-user-guide-2/index.html
  22. +132 −189 _site/2008/06/list-all-controllers-and-actions-2/index.html
  23. +131 −188 _site/2008/07/apache-x-sendfile-in-rails-2/index.html
  24. +131 −188 _site/2008/07/finally-decided-jquery-not-prototype-2/index.html
  25. +131 −188 _site/2008/07/how-to-save-money-in-your-startup-company-2/index.html
  26. +131 −188 _site/2008/07/rails-il-finally-2/index.html
  27. +131 −188 _site/2008/07/rails-tip-annotate-models-2/index.html
  28. +131 −188 _site/2008/07/rails-tip-ar-eager-loading-and-select-2/index.html
  29. +131 −188 _site/2008/07/rails-tip-image_tag-seo-optimization-2/index.html
  30. +131 −188 _site/2008/07/rails-tip-render-better-js-later-2/index.html
  31. +131 −188 _site/2008/07/randexp-gem-2/index.html
  32. +131 −188 _site/2008/07/restful-web-services-gem-2/index.html
  33. +131 −188 _site/2008/07/ruby-coding-convetions-2/index.html
  34. +131 −188 _site/2008/07/ruby-on-rails-screen-casts-rated-r-2/index.html
  35. +131 −188 _site/2008/07/run-ruby-runnn-2/index.html
  36. +131 −188 _site/2008/07/top-10-design-mistakes-on-the-web-2/index.html
  37. +131 −188 _site/2008/07/use-facets-2/index.html
  38. +131 −188 _site/2008/07/web-2-0-validator-2/index.html
  39. +131 −188 _site/2008/09/activity_streams-plugins-for-rails-2/index.html
  40. +131 −188 _site/2008/10/78-ways-for-your-small-business-to-save-money-2/index.html
  41. +131 −188 _site/2008/10/dynamically-adding-a-text-field-with-autocomplete-2/index.html
  42. +131 −188 _site/2008/10/error-while-executing-gem-argumenterror-2/index.html
  43. +131 −188 _site/2008/10/free-svn-git-hosting-services-2/index.html
  44. +131 −188 _site/2008/10/google-analytics-tracking-ajax-and-flash-2/index.html
  45. +131 −188 _site/2008/10/ie-testing-internet-explorer-cannot-open-the-internet-site-operation-aborted-2/index.html
  46. +131 −188 _site/2008/10/javascript-logging-all-hail-to-blackbird-2/index.html
  47. +131 −188 _site/2008/10/lighting-fast-ruby-on-rails-security-checklist-2/index.html
  48. +131 −188 _site/2008/10/my-crunchbase-page-2/index.html
  49. +131 −188 _site/2008/10/precentage-proxy-for-ruby-s-numeric-class-2/index.html
  50. +131 −188 _site/2008/10/rails-plugin-dynamic-session-expiry-2/index.html
  51. +131 −188 _site/2008/10/rails-plugin-import_svn-2/index.html
  52. +131 −188 _site/2008/10/remote_form_for-with-no-ajax-support-2/index.html
  53. +131 −188 _site/2008/10/simple-install-git-on-leopard-2/index.html
  54. +131 −188 _site/2008/10/stepping-up-migrating-from-an-svn-to-a-git-repository-2/index.html
  55. +131 −188 _site/2008/10/string-boolean-methodmissing-fun-2/index.html
  56. +131 −188 _site/2008/10/tip-21-ruby-tricks-you-must-use-2/index.html
  57. +131 −188 _site/2008/10/tip-finding-all-unread-messages-in-your-gmail-inbox-2/index.html
  58. +131 −188 _site/2008/10/tip-installing-mysql-gem-on-leopard-2/index.html
  59. +132 −189 _site/2008/10/updated-brand-new-rails-security-for-2-1-2/index.html
Sorry, we could not display the entire diff because too many files (310) changed.
View
321 _site/2007/03/consult-the-console-2/index.html
@@ -1,200 +1,143 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>Emphasized Insanity - Consult the Console</title>
- <link href="/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css">
- <link href="/stylesheets/bundle_common.css" media="screen" rel="stylesheet" type="text/css">
- <script type="text/javascript" charset="utf-8">
- var GitHub = {}
- var github_user = 'eladmeidar'
-
- </script>
- <script src="/javascripts/jquery.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_common.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_github.js" type="text/javascript"></script>
- <link href="http://blog.eizesus.com/feed/atom.xml" rel="alternate" title="Emphasized Insanity" type="application/atom+xml">
-
- <meta name="description" content="Ruby on Rails developer blog">
- </head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Emphasized Insanity - Consult the Console</title>
+ <script type="text/javascript" src="/javascripts/application.js"></script>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/application.css">
+<link rel="alternate" type="application/rss+xml" title="Emphasized Insanity - Elad Meidar" href="http://feeds.feedburner.com/EladOnRails" />
+</head>
<body>
-
- <div class="subnavd" id="main">
- <div id="header" class="pageheaded">
- <div class="site">
- <div class="logo">
- <a href="/"><h1>Emphasized Insanity</h1></a>
- </div>
- <div class="userbox">
- <div class="inner">
- <div class="avatarname">
- <a href="http://github.com/eladmeidar"><img alt="" src="/images/eladmeidar.jpg" height="20" width="20"></a>
- <a href="http://twitter.com/eladmeidar" class="name">@eladmeidar</a>
- </div>
- <ul class="usernav">
- <li><a href="/about.html">About me</a></li>
- <li><a href="http://www.linkedin.com/in/eladmeidar">LinkedIn</a></li>
- <li><a href="http://workingwithrails.com/person/5844-elad-meidar">WWR</a></li>
- <li><a href="http://github.com/eladmeidar">GitHub</a></li>
- <li><a href="http://www.nautilus6.com">My Company</a></li>
- </ul>
- </div>
- </div><!-- /.userbox -->
- <div class="topsearch">
-
- <form action="http://www.google.com/search?sitename=blog.eizesus.com" id="top_search_form" method="get">
- <input autocomplete="off" class="search my_repos_autocompleter notnative placeholder ac_input" name="q" results="5" placeholder="Search…" type="search"> <input value="Search" class="button" type="submit">
- <input type="hidden" name="sitesearch" value="blog.eizesus.com" checked=""/>
- </form>
-
- <ul class="nav">
- <li><a href="/archive.html">Explore Emphasized Insanity</a></li>
- </ul>
-
- </div>
+ <div id="wrap">
+ <div id="header">
+ <img src="/images/500.png" alt="Emphasized Insanity" />
+ <div id="summary">
+ <h1><strong>EmphasizedInsanity</strong> at <strong>/life
+ </strong></h1>
+ <h2>undefined method `Sanity` for #&lt;EladMeidar::Developer:0x12e0670&gt;</h2>
+ <ul>
+ <li class="first"><strong>file:</strong> <code>
+ brain.rb</code></li>
+ <li><strong>location:</strong> <code>instance_missing
+ </code></li>
+ <li class="last"><strong>line:
+ </strong> 1</li>
+ </ul>
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <div id="backtrace" class='expanded'>
+ <h3>BACKTRACE</h3>
+ <p><a href="#" id="expando"
+ onclick="toggleBacktrace(); return false">(condense)</a></p>
+ <p id="nav"><strong>JUMP TO:</strong>
+ <a href="#get-info">GET</a>
+ <a href="#post-info">POSTS</a>
+ <a href="#cookie-info">COOKIES</a>
+ <a href="#env-info">ENV</a>
+ </p>
+ <div class="clear"></div>
- </div>
- </div>
- <div class="site">
- <div class="pagehead repohead vis-public">
- <h1> <a href="/">Emphasized Insanity</a> / <strong><a href="/">Blog</a></strong> </h1>
- <ul class="actions">
- <li> <a href="http://blog.eizesus.com/feed/atom.xml" class="minibutton btn-watch " id="watch_button" style=""><span><span class="icon"></span>Subscribe</span></a></li>
- <li class="for-notforked" style=""><a href="#disqus-comments" class="minibutton btn-fork " id="fork_button"><span><span class="icon"></span>Comment</span></a></li>
- </ul>
- <ul class="tabs">
- <li><a href="/" class="selected" highlight="repo_source">Source</a></li>
- <li><a href="/archive.html" highlight="repo_commits">Archive</a></li>
- <li><a href="http://www.railsbridge.org" highlight="issues">RailsBridge</a></li>
- <li class="contextswitch nochoices">
- <span class="toggle leftwards">
- <em>Branch:</em>
- <code>master</code>
- </span>
- </li>
- </ul>
+ <ul id="backtrace-ul">
-<div class="subnav-bar">
- <ul>
- <li>
- <a href="#" class="dropdown">Switch Branches (1)</a>
- <ul>
- <li><strong>master ✓</strong></li>
+ <li class="frame-info framework">
+ <code>
+ No, this is not a real Sinatra error :). <br/>
+ This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).<br/>
+ I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
+ </code>
+ </li>
+ <li class="code framework">
+ </li>
</ul>
- </li>
- </ul>
-</div>
- <div id="repo_details" class="metabox clearfix pledgified">
- <div id="repo_details_loader" class="metabox-loader" style="display: none;">Sending Request…</div>
- <a href="#pledgie_box" rel="facebox" title="Brought to you by pledgie.com" class="pledgie pledgie-button for-owner tooltipped" id="activate_pledgie_button" style="display: none;"><span>Enable Donations</span></a>
- <div id="pledgie_box" style="display: none;">
- <h2>Pledgie Donations</h2>
- </div>
+ </div> <!-- /BACKTRACE -->
+
+ <div id="get">
+<a id="homepage_link" href="/">Back to Posts List</a>
+ <h3 id="get-info">GET</h3>
+ <h3 class="post_title"><a href="/2007/03/consult-the-console-2">Consult the Console</a></h3>
+ <div class="single_post">
+ <h1><span class="caps">OUT</span>-OF-<span class="caps">DATE</span></h1>
+<p><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Day to day life-shortening experiences</span><br /></span><span style="font-family:arial;">My current project is the biggest thing i had ever did, concerning web applications of course (i leave out my origami career).</span><br /><span style="font-family:arial;">We have two dedicated servers, 95 models, 45 high powered <span class="caps">DRY</span> controllers , a half-operational BackgroundDRb actions, a whole galaxy of multi-asserted tests, test-cases and a functional hell.</span><br /><span style="font-family:arial;">A pack of gems, half a dozen plugins and pack of nead to death programmers.</span><br /><span style="font-family:arial;">Not that we needed all that for the project, but once you get into a serious programming frenzy, the tendency is to push it as far as you can.</span><br /><br /><span style="font-family:arial;">The only thing worrying me was the debugging part, there is nothing in the world more helpless, irresponsible and depraved than a men in the depth of a debugging binge. I noticed that most of my guys aren&#8217;t using the real powers of the <span class="caps">IRB</span> god, and even more, they are not even aware to the hell that can be unleashed when using&#8230;</span><br /><br /><span style="font-family:arial;">the script/console..</span><br /><br /><br /><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Ok Ok, how?</span></span><br /><span style="font-family:arial;">The console is a simple, command lined interface to your application on any desired environment (specified as a parameter). Using the console you can try your relation in a less pre-defined way then the Testing mechanisem.<br />simply run <span style="font-weight: bold; color: rgb(255, 0, 0);font-family:courier new;" >script/console</span> in your application root, you will get a very innocent looking command line entry marker, just waiting for you to unleash the beast within&#8230; so&#8230; why keep it waiting?<br /><br /></span><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Tough love<br /></span></span><span style="font-family:arial;">One thing about the console, it&#8217;s output is simply readable once used right. Example.</span><br /><br /><span style="font-weight: bold; color: rgb(255, 0, 0);font-size:85%;" ><span style="font-family:courier new;">&gt;&gt; first = &#8220;i like&#8221;</span><br /><span style="font-family:courier new;">&#8220;i like&#8221;</span><br /><span style="font-family:courier new;">&gt;&gt; second = &#8220;bananas!&#8221;</span><br /><span style="font-family:courier new;">&#8220;bananas!&#8221;</span><br /><span style="font-family:courier new;">&gt;&gt; first + &quot; &quot; + second</span><br /><span style="font-family:courier new;">&#8220;i like bananas!&#8221;</span></span><br /><br /><span style="font-family:arial;">gee, this was fun&#8230; no?</span><br /><span style="font-family:arial;">never mind, the console is primarily used (by me at least) on Models, it enables you to play with your smelly database creatures, without hitting the refresh button on your browser like some kind of a disordered coffee machine&#8230; do i smell an example again?</span><br /><span style="font-size:85%;"><br /><span style="font-weight: bold; color: rgb(255, 0, 0);font-family:courier new;" >&gt;&gt; elad = SuperHero.find(:first, :conditions =&gt; &#8220;very_hansom is <span class="caps">TRUE</span>&#8221;)</span></span><span style="font-size:85%;"><br /><span style="font-family:courier new;"><span style="font-weight: bold; color: rgb(255, 0, 0);">#</span><superhero:0x2645874 attributes="{"><span style="font-weight: bold; color: rgb(255, 0, 0);">&#8220;elad&#8221;, &#8220;IQ&#8221;=&gt;&quot;7&quot;}&gt;</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&gt;&gt; elad.respond_to?(:fly_to) # Just checking if our superhero can fly</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">true # alright! my very own flying superhero!</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&gt;&gt; elad.fly_to(&#8220;Liverpool&#8221;) # Mercy-side here i come!</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&gt;&gt; elad.location</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&#8220;Liverpool&#8221;</span><br /><br /><span style=";font-family:arial;font-size:100%;" >ok, you got the idea.<br />I Consider myself to be rather a lazy programmer and in fact a person. I found a few other situations where the Rails console might come handy.<br /></span><span style="font-family:arial;"> </span><br /></superhero:0x2645874></span></span><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Going on a date!<br /></span></span><span style="font-family:arial;"></span><br /><span style="font-family:arial;">i wanted to check when will one of my packages arrives to it&#8217;s destination, the nice clerk told me that it will take about 3 weeks before it will get there.</span><br /><span style="font-family:arial;">damn, my mathematical skills are weaker even when being compared to my x-ray vision skills. so i immediatly called my favorite problem solver&#8230; the console</span><br /><br /><span style="font-weight: bold; color: rgb(255, 0, 0);font-size:85%;" ><span style="font-family:courier new;">&gt;&gt; when will my package arrive to destination? # it will never work, just trying :)</span><br /><span style="font-family:courier new;">SyntaxError: compile error</span><br /><span style="font-family:courier new;">(irb):1: syntax error, unexpected kWHEN</span><br /><span style="font-family:courier new;">when will my package arrive to destination?</span><br /><span style="font-family:courier new;"> ^</span><br /><span style="font-family:courier new;"> from (irb):1 # Damn :)</span><br /><span style="font-family:courier new;">&gt;&gt; 3.weeks.from_now</span><br /><span style="font-family:courier new;"> Thu Apr 05 17:54:22 <span class="caps">IDT</span> 2007</span></span><br /><br />yippie!, i immediatly called my Samoan clients and to wait for their next gun shipment on april 5th.<br /><br />Just kidding :), but isn&#8217;t it beautiful?</p>
+ </div>
+ <div class="clear"></div>
+</div> <!-- /GET -->
- <div id="repository_description" rel="repository_description_edit">
- <p>
- This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
- </p>
- <p>
- I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).
- </p>
- </div>
- </div>
- </div><!-- /.pagehead -->
- <div id="commit">
- <div class="group">
- <div class="envelope commit">
- <div class="human">
- <div class="message"><pre>Recent Posts</pre></div>
+<div id="post">
+ <h3 id="post-info">POST</h3>
+ <div class="clear"></div>
+</div> <!-- /POST -->
+
+ <div id="cookies">
+ <h3 id="cookie-info">COOKIES</h3>
+
+ <p class="no-data">I Don't have cookies.</p>
+ <div class="clear"></div>
+ </div> <!-- /COOKIES -->
- <div class="actor">
- <div class="gravatar">
- <img alt="" src="images/eladmeidar.jpg" height="30" width="30">
- </div>
- <div class="name"><a href="/">Elad Meidar</a>
- <span>(author)</span>
- </div>
- <div class="date">
- <abbr class="relatize relatized" title="1984-06-19 06:06:07">about 25 years ago</abbr>
- </div>
- </div>
- </div>
- <div class="machine">
- <span>c</span>ommit&nbsp;&nbsp;<a href="#" hotkey="c">60fa264c54341711baef087347105a5b9dd68863</a><br>
- <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" hotkey="t">508268ee6774e5c6060585718705f1ec7afa80d8</a><br>
- <span>p</span>arent&nbsp; <a href="#" hotkey="p">179f7c0440e6073779efc40366c6ced3a9888f71</a>
- </div>
- </div>
+ <div id="rack">
+ <h3 id="env-info">ELAD ENV</h3>
+ <table class="req">
+ <tr>
+ <th>Variable</th>
+ <th>Value</th>
+ </tr>
+
+ <tr>
+ <td>LINKEDIN</td>
+ <td class="code"><div><a href="http://www.linkedin.com/in/eladmeidar">http://www.linkedin.com/in/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>TWITTER</td>
+ <td class="code"><div><a href="http://www.twitter.com/eladmeidar">http://www.twitter.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>FACEBOOK</td>
+ <td class="code"><div><a href="http://www.facebook.com/eladmeidar">http://www.facebook.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>GITHUB</td>
+ <td class="code"><div><a href="http://github.com/eladmeidar">http://github.com/eladmeidar</a></div></td>
+ </tr>
- </div>
- </div>
- <div id="path">
- <b><a href="/2007/03/consult-the-console-2">Consult the Console</a></b> /
- </div>
- <div id="browser">
- <table cellpadding="0" cellspacing="0">
- <tbody><tr>
- <th></th>
- <th width="400p">name</th>
- <th>age</th>
- <th>
- history
- </th>
- </tr>
- <tr class="alt">
- <td class="icon"> <img alt="file" src="/images/txt.png"> </td>
- <td class="content">
- <a href="/2007/03/consult-the-console-2" id="d8f8d46921aa81abc4c0d27703a8908333ae38c3">Consult the Console</a>
- </td>
- <td class="age">
- <span class="relatize relatized">15/03/2007</span>
- </td>
- <td class="message">
- <a href="/2007/03/consult-the-console-2" class="message" title="another post">Another post</a> [Elad Meidar]
- </td>
- </tr>
- </tbody></table>
-</div>
- <div id="readme" class="announce"><span class="name"></span>
- <div class="wikistyle">
- <h1><span class="caps">OUT</span>-OF-<span class="caps">DATE</span></h1>
-<p><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Day to day life-shortening experiences</span><br /></span><span style="font-family:arial;">My current project is the biggest thing i had ever did, concerning web applications of course (i leave out my origami career).</span><br /><span style="font-family:arial;">We have two dedicated servers, 95 models, 45 high powered <span class="caps">DRY</span> controllers , a half-operational BackgroundDRb actions, a whole galaxy of multi-asserted tests, test-cases and a functional hell.</span><br /><span style="font-family:arial;">A pack of gems, half a dozen plugins and pack of nead to death programmers.</span><br /><span style="font-family:arial;">Not that we needed all that for the project, but once you get into a serious programming frenzy, the tendency is to push it as far as you can.</span><br /><br /><span style="font-family:arial;">The only thing worrying me was the debugging part, there is nothing in the world more helpless, irresponsible and depraved than a men in the depth of a debugging binge. I noticed that most of my guys aren&#8217;t using the real powers of the <span class="caps">IRB</span> god, and even more, they are not even aware to the hell that can be unleashed when using&#8230;</span><br /><br /><span style="font-family:arial;">the script/console..</span><br /><br /><br /><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Ok Ok, how?</span></span><br /><span style="font-family:arial;">The console is a simple, command lined interface to your application on any desired environment (specified as a parameter). Using the console you can try your relation in a less pre-defined way then the Testing mechanisem.<br />simply run <span style="font-weight: bold; color: rgb(255, 0, 0);font-family:courier new;" >script/console</span> in your application root, you will get a very innocent looking command line entry marker, just waiting for you to unleash the beast within&#8230; so&#8230; why keep it waiting?<br /><br /></span><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Tough love<br /></span></span><span style="font-family:arial;">One thing about the console, it&#8217;s output is simply readable once used right. Example.</span><br /><br /><span style="font-weight: bold; color: rgb(255, 0, 0);font-size:85%;" ><span style="font-family:courier new;">&gt;&gt; first = &#8220;i like&#8221;</span><br /><span style="font-family:courier new;">&#8220;i like&#8221;</span><br /><span style="font-family:courier new;">&gt;&gt; second = &#8220;bananas!&#8221;</span><br /><span style="font-family:courier new;">&#8220;bananas!&#8221;</span><br /><span style="font-family:courier new;">&gt;&gt; first + &quot; &quot; + second</span><br /><span style="font-family:courier new;">&#8220;i like bananas!&#8221;</span></span><br /><br /><span style="font-family:arial;">gee, this was fun&#8230; no?</span><br /><span style="font-family:arial;">never mind, the console is primarily used (by me at least) on Models, it enables you to play with your smelly database creatures, without hitting the refresh button on your browser like some kind of a disordered coffee machine&#8230; do i smell an example again?</span><br /><span style="font-size:85%;"><br /><span style="font-weight: bold; color: rgb(255, 0, 0);font-family:courier new;" >&gt;&gt; elad = SuperHero.find(:first, :conditions =&gt; &#8220;very_hansom is <span class="caps">TRUE</span>&#8221;)</span></span><span style="font-size:85%;"><br /><span style="font-family:courier new;"><span style="font-weight: bold; color: rgb(255, 0, 0);">#</span><superhero:0x2645874 attributes="{"><span style="font-weight: bold; color: rgb(255, 0, 0);">&#8220;elad&#8221;, &#8220;IQ&#8221;=&gt;&quot;7&quot;}&gt;</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&gt;&gt; elad.respond_to?(:fly_to) # Just checking if our superhero can fly</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">true # alright! my very own flying superhero!</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&gt;&gt; elad.fly_to(&#8220;Liverpool&#8221;) # Mercy-side here i come!</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&gt;&gt; elad.location</span><br /><span style="font-weight: bold; color: rgb(255, 0, 0);">&#8220;Liverpool&#8221;</span><br /><br /><span style=";font-family:arial;font-size:100%;" >ok, you got the idea.<br />I Consider myself to be rather a lazy programmer and in fact a person. I found a few other situations where the Rails console might come handy.<br /></span><span style="font-family:arial;"> </span><br /></superhero:0x2645874></span></span><span style="font-weight: bold;font-family:arial;font-size:180%;" ><span style="color: rgb(51, 204, 0);">Going on a date!<br /></span></span><span style="font-family:arial;"></span><br /><span style="font-family:arial;">i wanted to check when will one of my packages arrives to it&#8217;s destination, the nice clerk told me that it will take about 3 weeks before it will get there.</span><br /><span style="font-family:arial;">damn, my mathematical skills are weaker even when being compared to my x-ray vision skills. so i immediatly called my favorite problem solver&#8230; the console</span><br /><br /><span style="font-weight: bold; color: rgb(255, 0, 0);font-size:85%;" ><span style="font-family:courier new;">&gt;&gt; when will my package arrive to destination? # it will never work, just trying :)</span><br /><span style="font-family:courier new;">SyntaxError: compile error</span><br /><span style="font-family:courier new;">(irb):1: syntax error, unexpected kWHEN</span><br /><span style="font-family:courier new;">when will my package arrive to destination?</span><br /><span style="font-family:courier new;"> ^</span><br /><span style="font-family:courier new;"> from (irb):1 # Damn :)</span><br /><span style="font-family:courier new;">&gt;&gt; 3.weeks.from_now</span><br /><span style="font-family:courier new;"> Thu Apr 05 17:54:22 <span class="caps">IDT</span> 2007</span></span><br /><br />yippie!, i immediatly called my Samoan clients and to wait for their next gun shipment on april 5th.<br /><br />Just kidding :), but isn&#8217;t it beautiful?</p>
- </div>
- <div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/emphasizedinsanity/embed.js"></script><noscript><a href="http://emphasizedinsanity.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+ <tr>
+ <td>WWR</td>
+ <td class="code"><div><code>{ :working_with_rails => '<a href="http://www.workingwithrails.com/person/5844-elad-meidar">http://www.workingwithrails.com/person/5844-elad-meidar</a>' }</code></div></td>
+ </tr>
+
+ <tr>
+ <td>IRC</td>
+ <td class="code"><div><code>{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#jquery' ]}</code></div></td>
+ </tr>
+ <tr>
+ <td>SKYPE</td>
+ <td class="code"><div>eladmeidar</div></td>
+ </tr>
+ </table>
+ <div class="clear"></div>
+ </div> <!-- /RACK ENV -->
+
+ <div class="stats">
+ <p>
+ <a href="http://feeds2.feedburner.com/EladOnRails"><img src="http://feeds2.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=444444&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
+ <script type="text/javascript" language="javascript" src="http://twittercounter.com/embed/?username=eladmeidar&style=white"></script>
+ </p>
+ <p>
+ <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
+ <noscript>
+ <a href="http://s51.sitemeter.com/stats.asp?site=s51eizesusrulez" target="_top">
+ <img src="http://s51.sitemeter.com/meter.asp?site=s51eizesusrulez" alt="Site Meter" border="0"/></a>
+ </noscript>
+ </p>
+ <div class="clear"></div>
</div>
-</div>
- <div class="push"></div>
- </div>
+ <p id="explanation">You're seeing this error because I think it is funny.</p>
- <div id="footer">
- <div class="site">
- <div class="info">
- <div class="links">
- </div>
- <div class="company">
- <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
- <a href="http://feeds.feedburner.com/EladOnRails"><img src="http://feeds.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=660033&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
- </div>
- </div>
-
- <div class="sponsor">
- <div>
- </div>
- </div>
- </div>
-
-
- <div id="facebox" style="display: none;"> <div class="popup">
- <table> <tbody> <tr> <td
-class="tl"></td><td class="b"></td><td class="tr"></td> </tr>
- <tr> <td class="b"></td> <td
-class="body"> <div class="content"> </div>
- <div class="footer"> <a href="#"
-class="close"> <img src="index_files/closelabel.gif"
- title="close" class="close_image"> </a>
- </div> </td> <td class="b"></td>
- </tr> <tr> <td class="bl"></td><td
-class="b"></td><td class="br"></td> </tr> </tbody>
- </table> </div> </div></body></html>
+ </div> <!-- /WRAP -->
+ </body>
+</html>
View
319 _site/2007/03/the-boolean-connection-2/index.html
@@ -1,199 +1,142 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>Emphasized Insanity - The Boolean connection</title>
- <link href="/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css">
- <link href="/stylesheets/bundle_common.css" media="screen" rel="stylesheet" type="text/css">
- <script type="text/javascript" charset="utf-8">
- var GitHub = {}
- var github_user = 'eladmeidar'
-
- </script>
- <script src="/javascripts/jquery.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_common.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_github.js" type="text/javascript"></script>
- <link href="http://blog.eizesus.com/feed/atom.xml" rel="alternate" title="Emphasized Insanity" type="application/atom+xml">
-
- <meta name="description" content="Ruby on Rails developer blog">
- </head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Emphasized Insanity - The Boolean connection</title>
+ <script type="text/javascript" src="/javascripts/application.js"></script>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/application.css">
+<link rel="alternate" type="application/rss+xml" title="Emphasized Insanity - Elad Meidar" href="http://feeds.feedburner.com/EladOnRails" />
+</head>
<body>
-
- <div class="subnavd" id="main">
- <div id="header" class="pageheaded">
- <div class="site">
- <div class="logo">
- <a href="/"><h1>Emphasized Insanity</h1></a>
- </div>
- <div class="userbox">
- <div class="inner">
- <div class="avatarname">
- <a href="http://github.com/eladmeidar"><img alt="" src="/images/eladmeidar.jpg" height="20" width="20"></a>
- <a href="http://twitter.com/eladmeidar" class="name">@eladmeidar</a>
- </div>
- <ul class="usernav">
- <li><a href="/about.html">About me</a></li>
- <li><a href="http://www.linkedin.com/in/eladmeidar">LinkedIn</a></li>
- <li><a href="http://workingwithrails.com/person/5844-elad-meidar">WWR</a></li>
- <li><a href="http://github.com/eladmeidar">GitHub</a></li>
- <li><a href="http://www.nautilus6.com">My Company</a></li>
- </ul>
- </div>
- </div><!-- /.userbox -->
- <div class="topsearch">
-
- <form action="http://www.google.com/search?sitename=blog.eizesus.com" id="top_search_form" method="get">
- <input autocomplete="off" class="search my_repos_autocompleter notnative placeholder ac_input" name="q" results="5" placeholder="Search…" type="search"> <input value="Search" class="button" type="submit">
- <input type="hidden" name="sitesearch" value="blog.eizesus.com" checked=""/>
- </form>
-
- <ul class="nav">
- <li><a href="/archive.html">Explore Emphasized Insanity</a></li>
- </ul>
-
- </div>
+ <div id="wrap">
+ <div id="header">
+ <img src="/images/500.png" alt="Emphasized Insanity" />
+ <div id="summary">
+ <h1><strong>EmphasizedInsanity</strong> at <strong>/life
+ </strong></h1>
+ <h2>undefined method `Sanity` for #&lt;EladMeidar::Developer:0x12e0670&gt;</h2>
+ <ul>
+ <li class="first"><strong>file:</strong> <code>
+ brain.rb</code></li>
+ <li><strong>location:</strong> <code>instance_missing
+ </code></li>
+ <li class="last"><strong>line:
+ </strong> 1</li>
+ </ul>
+ </div>
+ <div class="clear"></div>
+ </div>
- </div>
- </div>
- <div class="site">
- <div class="pagehead repohead vis-public">
- <h1> <a href="/">Emphasized Insanity</a> / <strong><a href="/">Blog</a></strong> </h1>
- <ul class="actions">
- <li> <a href="http://blog.eizesus.com/feed/atom.xml" class="minibutton btn-watch " id="watch_button" style=""><span><span class="icon"></span>Subscribe</span></a></li>
- <li class="for-notforked" style=""><a href="#disqus-comments" class="minibutton btn-fork " id="fork_button"><span><span class="icon"></span>Comment</span></a></li>
- </ul>
- <ul class="tabs">
- <li><a href="/" class="selected" highlight="repo_source">Source</a></li>
- <li><a href="/archive.html" highlight="repo_commits">Archive</a></li>
- <li><a href="http://www.railsbridge.org" highlight="issues">RailsBridge</a></li>
- <li class="contextswitch nochoices">
- <span class="toggle leftwards">
- <em>Branch:</em>
- <code>master</code>
- </span>
- </li>
- </ul>
+ <div id="backtrace" class='expanded'>
+ <h3>BACKTRACE</h3>
+ <p><a href="#" id="expando"
+ onclick="toggleBacktrace(); return false">(condense)</a></p>
+ <p id="nav"><strong>JUMP TO:</strong>
+ <a href="#get-info">GET</a>
+ <a href="#post-info">POSTS</a>
+ <a href="#cookie-info">COOKIES</a>
+ <a href="#env-info">ENV</a>
+ </p>
+ <div class="clear"></div>
-<div class="subnav-bar">
- <ul>
- <li>
- <a href="#" class="dropdown">Switch Branches (1)</a>
- <ul>
- <li><strong>master ✓</strong></li>
+ <ul id="backtrace-ul">
+
+ <li class="frame-info framework">
+ <code>
+ No, this is not a real Sinatra error :). <br/>
+ This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).<br/>
+ I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
+ </code>
+ </li>
+ <li class="code framework">
+ </li>
</ul>
- </li>
- </ul>
-</div>
- <div id="repo_details" class="metabox clearfix pledgified">
- <div id="repo_details_loader" class="metabox-loader" style="display: none;">Sending Request…</div>
- <a href="#pledgie_box" rel="facebox" title="Brought to you by pledgie.com" class="pledgie pledgie-button for-owner tooltipped" id="activate_pledgie_button" style="display: none;"><span>Enable Donations</span></a>
- <div id="pledgie_box" style="display: none;">
- <h2>Pledgie Donations</h2>
- </div>
+ </div> <!-- /BACKTRACE -->
+
+ <div id="get">
+<a id="homepage_link" href="/">Back to Posts List</a>
+ <h3 id="get-info">GET</h3>
+ <h3 class="post_title"><a href="/2007/03/the-boolean-connection-2">The Boolean connection</a></h3>
+ <div class="single_post">
+ <p>Few people understand the true mentality of dealing with a Boolean variable.<br />The normal programmer will panic, and immediately attempt to compare it to a Boolean constant.<br /><br />when using Rails, This is wrong.<br /><br />When migrating a boolean typed column using Rails, the actual column type created is &#8220;tinyint(1)&#8221; (a single digit number presentation which means that the actual value being saved is 0&#8217;s or 1&#8217;s.<br />Where is the problem? in Ruby for a change.<br />In Ruby, everything except <strong>nil</strong> and <strong>false</strong> is considered to a true value. In C, Python and many other languages, 0 and possibly other values, such as empty lists, are considered as false.<br /><br />which brings us to the inevitable conclusion, that simplay comparing boolean values to <span style="font-weight: bold;">true</span> or <span style="font-weight: bold;">false</span> will not do.<br /><br />Rails solves this tiny issue for us, for each boolean attribute, Rails implements a &#8220;query method&#8221; as i prefer to call them. These query methods are simply called by issuing the boolean attribute name with a &#8220;?&#8221; suffix.<br /><br />for example, the <span style="font-weight: bold;"><code>mail_message&lt;/span&gt; instance object has a &lt;span style="font-weight: bold;"&gt;is_important&lt;/span&gt; boolean attribute, so instead of doing:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;</code>mail_message.is_important == true<br /></code><br />or whatever, we can simply ask rails by:<br /><code>&lt;br /&gt;@mail_message.is_important?&lt;br /&gt;</code><br /><br />beautiful&#8230; isn&#8217;t it?</p>
+ </div>
+ <div class="clear"></div>
+</div> <!-- /GET -->
- <div id="repository_description" rel="repository_description_edit">
- <p>
- This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
- </p>
- <p>
- I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).
- </p>
- </div>
- </div>
- </div><!-- /.pagehead -->
- <div id="commit">
- <div class="group">
- <div class="envelope commit">
- <div class="human">
- <div class="message"><pre>Recent Posts</pre></div>
+<div id="post">
+ <h3 id="post-info">POST</h3>
+ <div class="clear"></div>
+</div> <!-- /POST -->
+
+ <div id="cookies">
+ <h3 id="cookie-info">COOKIES</h3>
+
+ <p class="no-data">I Don't have cookies.</p>
+ <div class="clear"></div>
+ </div> <!-- /COOKIES -->
- <div class="actor">
- <div class="gravatar">
- <img alt="" src="images/eladmeidar.jpg" height="30" width="30">
- </div>
- <div class="name"><a href="/">Elad Meidar</a>
- <span>(author)</span>
- </div>
- <div class="date">
- <abbr class="relatize relatized" title="1984-06-19 06:06:07">about 25 years ago</abbr>
- </div>
- </div>
- </div>
- <div class="machine">
- <span>c</span>ommit&nbsp;&nbsp;<a href="#" hotkey="c">60fa264c54341711baef087347105a5b9dd68863</a><br>
- <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" hotkey="t">508268ee6774e5c6060585718705f1ec7afa80d8</a><br>
- <span>p</span>arent&nbsp; <a href="#" hotkey="p">179f7c0440e6073779efc40366c6ced3a9888f71</a>
- </div>
- </div>
+ <div id="rack">
+ <h3 id="env-info">ELAD ENV</h3>
+ <table class="req">
+ <tr>
+ <th>Variable</th>
+ <th>Value</th>
+ </tr>
+
+ <tr>
+ <td>LINKEDIN</td>
+ <td class="code"><div><a href="http://www.linkedin.com/in/eladmeidar">http://www.linkedin.com/in/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>TWITTER</td>
+ <td class="code"><div><a href="http://www.twitter.com/eladmeidar">http://www.twitter.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>FACEBOOK</td>
+ <td class="code"><div><a href="http://www.facebook.com/eladmeidar">http://www.facebook.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>GITHUB</td>
+ <td class="code"><div><a href="http://github.com/eladmeidar">http://github.com/eladmeidar</a></div></td>
+ </tr>
- </div>
- </div>
- <div id="path">
- <b><a href="/2007/03/the-boolean-connection-2">The Boolean connection</a></b> /
- </div>
- <div id="browser">
- <table cellpadding="0" cellspacing="0">
- <tbody><tr>
- <th></th>
- <th width="400p">name</th>
- <th>age</th>
- <th>
- history
- </th>
- </tr>
- <tr class="alt">
- <td class="icon"> <img alt="file" src="/images/txt.png"> </td>
- <td class="content">
- <a href="/2007/03/the-boolean-connection-2" id="d8f8d46921aa81abc4c0d27703a8908333ae38c3">The Boolean connection</a>
- </td>
- <td class="age">
- <span class="relatize relatized">14/03/2007</span>
- </td>
- <td class="message">
- <a href="/2007/03/the-boolean-connection-2" class="message" title="another post">Another post</a> [Elad Meidar]
- </td>
- </tr>
- </tbody></table>
-</div>
- <div id="readme" class="announce"><span class="name"></span>
- <div class="wikistyle">
- <p>Few people understand the true mentality of dealing with a Boolean variable.<br />The normal programmer will panic, and immediately attempt to compare it to a Boolean constant.<br /><br />when using Rails, This is wrong.<br /><br />When migrating a boolean typed column using Rails, the actual column type created is &#8220;tinyint(1)&#8221; (a single digit number presentation which means that the actual value being saved is 0&#8217;s or 1&#8217;s.<br />Where is the problem? in Ruby for a change.<br />In Ruby, everything except <strong>nil</strong> and <strong>false</strong> is considered to a true value. In C, Python and many other languages, 0 and possibly other values, such as empty lists, are considered as false.<br /><br />which brings us to the inevitable conclusion, that simplay comparing boolean values to <span style="font-weight: bold;">true</span> or <span style="font-weight: bold;">false</span> will not do.<br /><br />Rails solves this tiny issue for us, for each boolean attribute, Rails implements a &#8220;query method&#8221; as i prefer to call them. These query methods are simply called by issuing the boolean attribute name with a &#8220;?&#8221; suffix.<br /><br />for example, the <span style="font-weight: bold;"><code>mail_message&lt;/span&gt; instance object has a &lt;span style="font-weight: bold;"&gt;is_important&lt;/span&gt; boolean attribute, so instead of doing:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;</code>mail_message.is_important == true<br /></code><br />or whatever, we can simply ask rails by:<br /><code>&lt;br /&gt;@mail_message.is_important?&lt;br /&gt;</code><br /><br />beautiful&#8230; isn&#8217;t it?</p>
- </div>
- <div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/emphasizedinsanity/embed.js"></script><noscript><a href="http://emphasizedinsanity.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+ <tr>
+ <td>WWR</td>
+ <td class="code"><div><code>{ :working_with_rails => '<a href="http://www.workingwithrails.com/person/5844-elad-meidar">http://www.workingwithrails.com/person/5844-elad-meidar</a>' }</code></div></td>
+ </tr>
+
+ <tr>
+ <td>IRC</td>
+ <td class="code"><div><code>{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#jquery' ]}</code></div></td>
+ </tr>
+ <tr>
+ <td>SKYPE</td>
+ <td class="code"><div>eladmeidar</div></td>
+ </tr>
+ </table>
+ <div class="clear"></div>
+ </div> <!-- /RACK ENV -->
+
+ <div class="stats">
+ <p>
+ <a href="http://feeds2.feedburner.com/EladOnRails"><img src="http://feeds2.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=444444&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
+ <script type="text/javascript" language="javascript" src="http://twittercounter.com/embed/?username=eladmeidar&style=white"></script>
+ </p>
+ <p>
+ <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
+ <noscript>
+ <a href="http://s51.sitemeter.com/stats.asp?site=s51eizesusrulez" target="_top">
+ <img src="http://s51.sitemeter.com/meter.asp?site=s51eizesusrulez" alt="Site Meter" border="0"/></a>
+ </noscript>
+ </p>
+ <div class="clear"></div>
</div>
-</div>
- <div class="push"></div>
- </div>
+ <p id="explanation">You're seeing this error because I think it is funny.</p>
- <div id="footer">
- <div class="site">
- <div class="info">
- <div class="links">
- </div>
- <div class="company">
- <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
- <a href="http://feeds.feedburner.com/EladOnRails"><img src="http://feeds.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=660033&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
- </div>
- </div>
-
- <div class="sponsor">
- <div>
- </div>
- </div>
- </div>
-
-
- <div id="facebox" style="display: none;"> <div class="popup">
- <table> <tbody> <tr> <td
-class="tl"></td><td class="b"></td><td class="tr"></td> </tr>
- <tr> <td class="b"></td> <td
-class="body"> <div class="content"> </div>
- <div class="footer"> <a href="#"
-class="close"> <img src="index_files/closelabel.gif"
- title="close" class="close_image"> </a>
- </div> </td> <td class="b"></td>
- </tr> <tr> <td class="bl"></td><td
-class="b"></td><td class="br"></td> </tr> </tbody>
- </table> </div> </div></body></html>
+ </div> <!-- /WRAP -->
+ </body>
+</html>
View
319 _site/2007/03/the-chronic-files-2/index.html
@@ -1,199 +1,142 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>Emphasized Insanity - The Chronic files</title>
- <link href="/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css">
- <link href="/stylesheets/bundle_common.css" media="screen" rel="stylesheet" type="text/css">
- <script type="text/javascript" charset="utf-8">
- var GitHub = {}
- var github_user = 'eladmeidar'
-
- </script>
- <script src="/javascripts/jquery.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_common.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_github.js" type="text/javascript"></script>
- <link href="http://blog.eizesus.com/feed/atom.xml" rel="alternate" title="Emphasized Insanity" type="application/atom+xml">
-
- <meta name="description" content="Ruby on Rails developer blog">
- </head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Emphasized Insanity - The Chronic files</title>
+ <script type="text/javascript" src="/javascripts/application.js"></script>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/application.css">
+<link rel="alternate" type="application/rss+xml" title="Emphasized Insanity - Elad Meidar" href="http://feeds.feedburner.com/EladOnRails" />
+</head>
<body>
-
- <div class="subnavd" id="main">
- <div id="header" class="pageheaded">
- <div class="site">
- <div class="logo">
- <a href="/"><h1>Emphasized Insanity</h1></a>
- </div>
- <div class="userbox">
- <div class="inner">
- <div class="avatarname">
- <a href="http://github.com/eladmeidar"><img alt="" src="/images/eladmeidar.jpg" height="20" width="20"></a>
- <a href="http://twitter.com/eladmeidar" class="name">@eladmeidar</a>
- </div>
- <ul class="usernav">
- <li><a href="/about.html">About me</a></li>
- <li><a href="http://www.linkedin.com/in/eladmeidar">LinkedIn</a></li>
- <li><a href="http://workingwithrails.com/person/5844-elad-meidar">WWR</a></li>
- <li><a href="http://github.com/eladmeidar">GitHub</a></li>
- <li><a href="http://www.nautilus6.com">My Company</a></li>
- </ul>
- </div>
- </div><!-- /.userbox -->
- <div class="topsearch">
-
- <form action="http://www.google.com/search?sitename=blog.eizesus.com" id="top_search_form" method="get">
- <input autocomplete="off" class="search my_repos_autocompleter notnative placeholder ac_input" name="q" results="5" placeholder="Search…" type="search"> <input value="Search" class="button" type="submit">
- <input type="hidden" name="sitesearch" value="blog.eizesus.com" checked=""/>
- </form>
-
- <ul class="nav">
- <li><a href="/archive.html">Explore Emphasized Insanity</a></li>
- </ul>
-
- </div>
+ <div id="wrap">
+ <div id="header">
+ <img src="/images/500.png" alt="Emphasized Insanity" />
+ <div id="summary">
+ <h1><strong>EmphasizedInsanity</strong> at <strong>/life
+ </strong></h1>
+ <h2>undefined method `Sanity` for #&lt;EladMeidar::Developer:0x12e0670&gt;</h2>
+ <ul>
+ <li class="first"><strong>file:</strong> <code>
+ brain.rb</code></li>
+ <li><strong>location:</strong> <code>instance_missing
+ </code></li>
+ <li class="last"><strong>line:
+ </strong> 1</li>
+ </ul>
+ </div>
+ <div class="clear"></div>
+ </div>
- </div>
- </div>
- <div class="site">
- <div class="pagehead repohead vis-public">
- <h1> <a href="/">Emphasized Insanity</a> / <strong><a href="/">Blog</a></strong> </h1>
- <ul class="actions">
- <li> <a href="http://blog.eizesus.com/feed/atom.xml" class="minibutton btn-watch " id="watch_button" style=""><span><span class="icon"></span>Subscribe</span></a></li>
- <li class="for-notforked" style=""><a href="#disqus-comments" class="minibutton btn-fork " id="fork_button"><span><span class="icon"></span>Comment</span></a></li>
- </ul>
- <ul class="tabs">
- <li><a href="/" class="selected" highlight="repo_source">Source</a></li>
- <li><a href="/archive.html" highlight="repo_commits">Archive</a></li>
- <li><a href="http://www.railsbridge.org" highlight="issues">RailsBridge</a></li>
- <li class="contextswitch nochoices">
- <span class="toggle leftwards">
- <em>Branch:</em>
- <code>master</code>
- </span>
- </li>
- </ul>
+ <div id="backtrace" class='expanded'>
+ <h3>BACKTRACE</h3>
+ <p><a href="#" id="expando"
+ onclick="toggleBacktrace(); return false">(condense)</a></p>
+ <p id="nav"><strong>JUMP TO:</strong>
+ <a href="#get-info">GET</a>
+ <a href="#post-info">POSTS</a>
+ <a href="#cookie-info">COOKIES</a>
+ <a href="#env-info">ENV</a>
+ </p>
+ <div class="clear"></div>
-<div class="subnav-bar">
- <ul>
- <li>
- <a href="#" class="dropdown">Switch Branches (1)</a>
- <ul>
- <li><strong>master ✓</strong></li>
+ <ul id="backtrace-ul">
+
+ <li class="frame-info framework">
+ <code>
+ No, this is not a real Sinatra error :). <br/>
+ This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).<br/>
+ I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
+ </code>
+ </li>
+ <li class="code framework">
+ </li>
</ul>
- </li>
- </ul>
-</div>
- <div id="repo_details" class="metabox clearfix pledgified">
- <div id="repo_details_loader" class="metabox-loader" style="display: none;">Sending Request…</div>
- <a href="#pledgie_box" rel="facebox" title="Brought to you by pledgie.com" class="pledgie pledgie-button for-owner tooltipped" id="activate_pledgie_button" style="display: none;"><span>Enable Donations</span></a>
- <div id="pledgie_box" style="display: none;">
- <h2>Pledgie Donations</h2>
- </div>
+ </div> <!-- /BACKTRACE -->
+
+ <div id="get">
+<a id="homepage_link" href="/">Back to Posts List</a>
+ <h3 id="get-info">GET</h3>
+ <h3 class="post_title"><a href="/2007/03/the-chronic-files-2">The Chronic files</a></h3>
+ <div class="single_post">
+ <p><span style="font-size:85%;"><span style="font-family: arial;">Although 20.days.ago is a very nice syntax and caused so many non-rails programmers to pass out almost naturally after seeing it work, it still ain&#8217;t enough.</span><br /><br /><span style="font-family: arial;">The Chronic gem enables parsing for date-description strings.</span><br /><span style="font-family: arial;">such &#8220;yesterday morning&#8221; or &#8220;sunday next month&#8221;, Chronic will parse these strings into actual Time objects.</span><br /><br /><a style="font-family: arial;" href="http://chronic.rubyforge.org/">Read more&#8230;</a></span></p>
+ </div>
+ <div class="clear"></div>
+</div> <!-- /GET -->
- <div id="repository_description" rel="repository_description_edit">
- <p>
- This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
- </p>
- <p>
- I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).
- </p>
- </div>
- </div>
- </div><!-- /.pagehead -->
- <div id="commit">
- <div class="group">
- <div class="envelope commit">
- <div class="human">
- <div class="message"><pre>Recent Posts</pre></div>
+<div id="post">
+ <h3 id="post-info">POST</h3>
+ <div class="clear"></div>
+</div> <!-- /POST -->
+
+ <div id="cookies">
+ <h3 id="cookie-info">COOKIES</h3>
+
+ <p class="no-data">I Don't have cookies.</p>
+ <div class="clear"></div>
+ </div> <!-- /COOKIES -->
- <div class="actor">
- <div class="gravatar">
- <img alt="" src="images/eladmeidar.jpg" height="30" width="30">
- </div>
- <div class="name"><a href="/">Elad Meidar</a>
- <span>(author)</span>
- </div>
- <div class="date">
- <abbr class="relatize relatized" title="1984-06-19 06:06:07">about 25 years ago</abbr>
- </div>
- </div>
- </div>
- <div class="machine">
- <span>c</span>ommit&nbsp;&nbsp;<a href="#" hotkey="c">60fa264c54341711baef087347105a5b9dd68863</a><br>
- <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" hotkey="t">508268ee6774e5c6060585718705f1ec7afa80d8</a><br>
- <span>p</span>arent&nbsp; <a href="#" hotkey="p">179f7c0440e6073779efc40366c6ced3a9888f71</a>
- </div>
- </div>
+ <div id="rack">
+ <h3 id="env-info">ELAD ENV</h3>
+ <table class="req">
+ <tr>
+ <th>Variable</th>
+ <th>Value</th>
+ </tr>
+
+ <tr>
+ <td>LINKEDIN</td>
+ <td class="code"><div><a href="http://www.linkedin.com/in/eladmeidar">http://www.linkedin.com/in/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>TWITTER</td>
+ <td class="code"><div><a href="http://www.twitter.com/eladmeidar">http://www.twitter.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>FACEBOOK</td>
+ <td class="code"><div><a href="http://www.facebook.com/eladmeidar">http://www.facebook.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>GITHUB</td>
+ <td class="code"><div><a href="http://github.com/eladmeidar">http://github.com/eladmeidar</a></div></td>
+ </tr>
- </div>
- </div>
- <div id="path">
- <b><a href="/2007/03/the-chronic-files-2">The Chronic files</a></b> /
- </div>
- <div id="browser">
- <table cellpadding="0" cellspacing="0">
- <tbody><tr>
- <th></th>
- <th width="400p">name</th>
- <th>age</th>
- <th>
- history
- </th>
- </tr>
- <tr class="alt">
- <td class="icon"> <img alt="file" src="/images/txt.png"> </td>
- <td class="content">
- <a href="/2007/03/the-chronic-files-2" id="d8f8d46921aa81abc4c0d27703a8908333ae38c3">The Chronic files</a>
- </td>
- <td class="age">
- <span class="relatize relatized">21/03/2007</span>
- </td>
- <td class="message">
- <a href="/2007/03/the-chronic-files-2" class="message" title="another post">Another post</a> [Elad Meidar]
- </td>
- </tr>
- </tbody></table>
-</div>
- <div id="readme" class="announce"><span class="name"></span>
- <div class="wikistyle">
- <p><span style="font-size:85%;"><span style="font-family: arial;">Although 20.days.ago is a very nice syntax and caused so many non-rails programmers to pass out almost naturally after seeing it work, it still ain&#8217;t enough.</span><br /><br /><span style="font-family: arial;">The Chronic gem enables parsing for date-description strings.</span><br /><span style="font-family: arial;">such &#8220;yesterday morning&#8221; or &#8220;sunday next month&#8221;, Chronic will parse these strings into actual Time objects.</span><br /><br /><a style="font-family: arial;" href="http://chronic.rubyforge.org/">Read more&#8230;</a></span></p>
- </div>
- <div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/emphasizedinsanity/embed.js"></script><noscript><a href="http://emphasizedinsanity.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+ <tr>
+ <td>WWR</td>
+ <td class="code"><div><code>{ :working_with_rails => '<a href="http://www.workingwithrails.com/person/5844-elad-meidar">http://www.workingwithrails.com/person/5844-elad-meidar</a>' }</code></div></td>
+ </tr>
+
+ <tr>
+ <td>IRC</td>
+ <td class="code"><div><code>{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#jquery' ]}</code></div></td>
+ </tr>
+ <tr>
+ <td>SKYPE</td>
+ <td class="code"><div>eladmeidar</div></td>
+ </tr>
+ </table>
+ <div class="clear"></div>
+ </div> <!-- /RACK ENV -->
+
+ <div class="stats">
+ <p>
+ <a href="http://feeds2.feedburner.com/EladOnRails"><img src="http://feeds2.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=444444&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
+ <script type="text/javascript" language="javascript" src="http://twittercounter.com/embed/?username=eladmeidar&style=white"></script>
+ </p>
+ <p>
+ <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
+ <noscript>
+ <a href="http://s51.sitemeter.com/stats.asp?site=s51eizesusrulez" target="_top">
+ <img src="http://s51.sitemeter.com/meter.asp?site=s51eizesusrulez" alt="Site Meter" border="0"/></a>
+ </noscript>
+ </p>
+ <div class="clear"></div>
</div>
-</div>
- <div class="push"></div>
- </div>
+ <p id="explanation">You're seeing this error because I think it is funny.</p>
- <div id="footer">
- <div class="site">
- <div class="info">
- <div class="links">
- </div>
- <div class="company">
- <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
- <a href="http://feeds.feedburner.com/EladOnRails"><img src="http://feeds.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=660033&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
- </div>
- </div>
-
- <div class="sponsor">
- <div>
- </div>
- </div>
- </div>
-
-
- <div id="facebox" style="display: none;"> <div class="popup">
- <table> <tbody> <tr> <td
-class="tl"></td><td class="b"></td><td class="tr"></td> </tr>
- <tr> <td class="b"></td> <td
-class="body"> <div class="content"> </div>
- <div class="footer"> <a href="#"
-class="close"> <img src="index_files/closelabel.gif"
- title="close" class="close_image"> </a>
- </div> </td> <td class="b"></td>
- </tr> <tr> <td class="bl"></td><td
-class="b"></td><td class="br"></td> </tr> </tbody>
- </table> </div> </div></body></html>
+ </div> <!-- /WRAP -->
+ </body>
+</html>
View
319 _site/2007/04/counter_cache-2/index.html
@@ -1,199 +1,142 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>Emphasized Insanity - counter_cache</title>
- <link href="/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css">
- <link href="/stylesheets/bundle_common.css" media="screen" rel="stylesheet" type="text/css">
- <script type="text/javascript" charset="utf-8">
- var GitHub = {}
- var github_user = 'eladmeidar'
-
- </script>
- <script src="/javascripts/jquery.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_common.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_github.js" type="text/javascript"></script>
- <link href="http://blog.eizesus.com/feed/atom.xml" rel="alternate" title="Emphasized Insanity" type="application/atom+xml">
-
- <meta name="description" content="Ruby on Rails developer blog">
- </head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Emphasized Insanity - counter_cache</title>
+ <script type="text/javascript" src="/javascripts/application.js"></script>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/application.css">
+<link rel="alternate" type="application/rss+xml" title="Emphasized Insanity - Elad Meidar" href="http://feeds.feedburner.com/EladOnRails" />
+</head>
<body>
-
- <div class="subnavd" id="main">
- <div id="header" class="pageheaded">
- <div class="site">
- <div class="logo">
- <a href="/"><h1>Emphasized Insanity</h1></a>
- </div>
- <div class="userbox">
- <div class="inner">
- <div class="avatarname">
- <a href="http://github.com/eladmeidar"><img alt="" src="/images/eladmeidar.jpg" height="20" width="20"></a>
- <a href="http://twitter.com/eladmeidar" class="name">@eladmeidar</a>
- </div>
- <ul class="usernav">
- <li><a href="/about.html">About me</a></li>
- <li><a href="http://www.linkedin.com/in/eladmeidar">LinkedIn</a></li>
- <li><a href="http://workingwithrails.com/person/5844-elad-meidar">WWR</a></li>
- <li><a href="http://github.com/eladmeidar">GitHub</a></li>
- <li><a href="http://www.nautilus6.com">My Company</a></li>
- </ul>
- </div>
- </div><!-- /.userbox -->
- <div class="topsearch">
-
- <form action="http://www.google.com/search?sitename=blog.eizesus.com" id="top_search_form" method="get">
- <input autocomplete="off" class="search my_repos_autocompleter notnative placeholder ac_input" name="q" results="5" placeholder="Search…" type="search"> <input value="Search" class="button" type="submit">
- <input type="hidden" name="sitesearch" value="blog.eizesus.com" checked=""/>
- </form>
-
- <ul class="nav">
- <li><a href="/archive.html">Explore Emphasized Insanity</a></li>
- </ul>
-
- </div>
+ <div id="wrap">
+ <div id="header">
+ <img src="/images/500.png" alt="Emphasized Insanity" />
+ <div id="summary">
+ <h1><strong>EmphasizedInsanity</strong> at <strong>/life
+ </strong></h1>
+ <h2>undefined method `Sanity` for #&lt;EladMeidar::Developer:0x12e0670&gt;</h2>
+ <ul>
+ <li class="first"><strong>file:</strong> <code>
+ brain.rb</code></li>
+ <li><strong>location:</strong> <code>instance_missing
+ </code></li>
+ <li class="last"><strong>line:
+ </strong> 1</li>
+ </ul>
+ </div>
+ <div class="clear"></div>
+ </div>
- </div>
- </div>
- <div class="site">
- <div class="pagehead repohead vis-public">
- <h1> <a href="/">Emphasized Insanity</a> / <strong><a href="/">Blog</a></strong> </h1>
- <ul class="actions">
- <li> <a href="http://blog.eizesus.com/feed/atom.xml" class="minibutton btn-watch " id="watch_button" style=""><span><span class="icon"></span>Subscribe</span></a></li>
- <li class="for-notforked" style=""><a href="#disqus-comments" class="minibutton btn-fork " id="fork_button"><span><span class="icon"></span>Comment</span></a></li>
- </ul>
- <ul class="tabs">
- <li><a href="/" class="selected" highlight="repo_source">Source</a></li>
- <li><a href="/archive.html" highlight="repo_commits">Archive</a></li>
- <li><a href="http://www.railsbridge.org" highlight="issues">RailsBridge</a></li>
- <li class="contextswitch nochoices">
- <span class="toggle leftwards">
- <em>Branch:</em>
- <code>master</code>
- </span>
- </li>
- </ul>
+ <div id="backtrace" class='expanded'>
+ <h3>BACKTRACE</h3>
+ <p><a href="#" id="expando"
+ onclick="toggleBacktrace(); return false">(condense)</a></p>
+ <p id="nav"><strong>JUMP TO:</strong>
+ <a href="#get-info">GET</a>
+ <a href="#post-info">POSTS</a>
+ <a href="#cookie-info">COOKIES</a>
+ <a href="#env-info">ENV</a>
+ </p>
+ <div class="clear"></div>
-<div class="subnav-bar">
- <ul>
- <li>
- <a href="#" class="dropdown">Switch Branches (1)</a>
- <ul>
- <li><strong>master ✓</strong></li>
+ <ul id="backtrace-ul">
+
+ <li class="frame-info framework">
+ <code>
+ No, this is not a real Sinatra error :). <br/>
+ This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).<br/>
+ I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
+ </code>
+ </li>
+ <li class="code framework">
+ </li>
</ul>
- </li>
- </ul>
-</div>
- <div id="repo_details" class="metabox clearfix pledgified">
- <div id="repo_details_loader" class="metabox-loader" style="display: none;">Sending Request…</div>
- <a href="#pledgie_box" rel="facebox" title="Brought to you by pledgie.com" class="pledgie pledgie-button for-owner tooltipped" id="activate_pledgie_button" style="display: none;"><span>Enable Donations</span></a>
- <div id="pledgie_box" style="display: none;">
- <h2>Pledgie Donations</h2>
- </div>
+ </div> <!-- /BACKTRACE -->
+
+ <div id="get">
+<a id="homepage_link" href="/">Back to Posts List</a>
+ <h3 id="get-info">GET</h3>
+ <h3 class="post_title"><a href="/2007/04/counter_cache-2">counter_cache</a></h3>
+ <div class="single_post">
+ <p><span style="font-family: arial;">Many times when using a <span style="font-style: italic;">belongs_to</span> relation, we encounter the need to size up that association, we can use 2 methods which are created for us, <span style="font-style: italic;">size</span> and <span style="font-style: italic;">(association_pluralization)<em>count<span style="font-style: italic;">.<br /></span></span><br />so if <span style="font-style: italic;">SuperHero</span> <span style="font-style: italic;">has_many :super_powers</span> than:<br /><br /><div style="border:1px solid black; padding: 5px;"><br />me = SuperHero.find(1)<br />me.super_powers<span style="color: rgb(255, 0, 0);">.<span style="color: rgb(204, 0, 0);">size</span></span><br />me.<span style="color: rgb(204, 0, 0);">super_powers_count<br /></div><br /><br /><span style="color: rgb(0, 0, 0);">they will both issue that same <span class="caps">SQL</span> statement at this point</span><br /><br /><div style="border: 1px solid black; padding: 5px;"><br /><span style="color: rgb(0, 0, 0);"><span class="caps">SELECT</span> count(*) as count_all <span class="caps">FROM</span> super_powers <span class="caps">WHERE</span> (super_hero_id = 1)</span><br /></div><br /><span style="color: rgb(0, 0, 0);">which basically preforms a <span class="caps">SELECT</span> * statement, we don&#8217;t like it :)<br /><br />the :counter_cache parameter for the belongs_to macro, indicates the use of a </span></span></span><span style="font-family: arial;"><span style="font-style: italic;">(association_pluralization)</em>count<span style="font-style: italic;"> </span></span>named <span style="font-weight: bold;">column</span> which will be incremented and decremented according to the use of the associative array, this can and does save a lot of time and DB &#8211; <span class="caps">APP</span> &#8211; DB roundup&#8217;s.<br /><br /> </span><br /><span style="font-family: arial;"><span style="color: rgb(204, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="font-style: italic;"><span style="font-style: italic;"></span></span></span></p>
+ </div>
+ <div class="clear"></div>
+</div> <!-- /GET -->
- <div id="repository_description" rel="repository_description_edit">
- <p>
- This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
- </p>
- <p>
- I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).
- </p>
- </div>
- </div>
- </div><!-- /.pagehead -->
- <div id="commit">
- <div class="group">
- <div class="envelope commit">
- <div class="human">
- <div class="message"><pre>Recent Posts</pre></div>
+<div id="post">
+ <h3 id="post-info">POST</h3>
+ <div class="clear"></div>
+</div> <!-- /POST -->
+
+ <div id="cookies">
+ <h3 id="cookie-info">COOKIES</h3>
+
+ <p class="no-data">I Don't have cookies.</p>
+ <div class="clear"></div>
+ </div> <!-- /COOKIES -->
- <div class="actor">
- <div class="gravatar">
- <img alt="" src="images/eladmeidar.jpg" height="30" width="30">
- </div>
- <div class="name"><a href="/">Elad Meidar</a>
- <span>(author)</span>
- </div>
- <div class="date">
- <abbr class="relatize relatized" title="1984-06-19 06:06:07">about 25 years ago</abbr>
- </div>
- </div>
- </div>
- <div class="machine">
- <span>c</span>ommit&nbsp;&nbsp;<a href="#" hotkey="c">60fa264c54341711baef087347105a5b9dd68863</a><br>
- <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" hotkey="t">508268ee6774e5c6060585718705f1ec7afa80d8</a><br>
- <span>p</span>arent&nbsp; <a href="#" hotkey="p">179f7c0440e6073779efc40366c6ced3a9888f71</a>
- </div>
- </div>
+ <div id="rack">
+ <h3 id="env-info">ELAD ENV</h3>
+ <table class="req">
+ <tr>
+ <th>Variable</th>
+ <th>Value</th>
+ </tr>
+
+ <tr>
+ <td>LINKEDIN</td>
+ <td class="code"><div><a href="http://www.linkedin.com/in/eladmeidar">http://www.linkedin.com/in/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>TWITTER</td>
+ <td class="code"><div><a href="http://www.twitter.com/eladmeidar">http://www.twitter.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>FACEBOOK</td>
+ <td class="code"><div><a href="http://www.facebook.com/eladmeidar">http://www.facebook.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>GITHUB</td>
+ <td class="code"><div><a href="http://github.com/eladmeidar">http://github.com/eladmeidar</a></div></td>
+ </tr>
- </div>
- </div>
- <div id="path">
- <b><a href="/2007/04/counter_cache-2">counter_cache</a></b> /
- </div>
- <div id="browser">
- <table cellpadding="0" cellspacing="0">
- <tbody><tr>
- <th></th>
- <th width="400p">name</th>
- <th>age</th>
- <th>
- history
- </th>
- </tr>
- <tr class="alt">
- <td class="icon"> <img alt="file" src="/images/txt.png"> </td>
- <td class="content">
- <a href="/2007/04/counter_cache-2" id="d8f8d46921aa81abc4c0d27703a8908333ae38c3">counter_cache</a>
- </td>
- <td class="age">
- <span class="relatize relatized">05/04/2007</span>
- </td>
- <td class="message">
- <a href="/2007/04/counter_cache-2" class="message" title="another post">Another post</a> [Elad Meidar]
- </td>
- </tr>
- </tbody></table>
-</div>
- <div id="readme" class="announce"><span class="name"></span>
- <div class="wikistyle">
- <p><span style="font-family: arial;">Many times when using a <span style="font-style: italic;">belongs_to</span> relation, we encounter the need to size up that association, we can use 2 methods which are created for us, <span style="font-style: italic;">size</span> and <span style="font-style: italic;">(association_pluralization)<em>count<span style="font-style: italic;">.<br /></span></span><br />so if <span style="font-style: italic;">SuperHero</span> <span style="font-style: italic;">has_many :super_powers</span> than:<br /><br /><div style="border:1px solid black; padding: 5px;"><br />me = SuperHero.find(1)<br />me.super_powers<span style="color: rgb(255, 0, 0);">.<span style="color: rgb(204, 0, 0);">size</span></span><br />me.<span style="color: rgb(204, 0, 0);">super_powers_count<br /></div><br /><br /><span style="color: rgb(0, 0, 0);">they will both issue that same <span class="caps">SQL</span> statement at this point</span><br /><br /><div style="border: 1px solid black; padding: 5px;"><br /><span style="color: rgb(0, 0, 0);"><span class="caps">SELECT</span> count(*) as count_all <span class="caps">FROM</span> super_powers <span class="caps">WHERE</span> (super_hero_id = 1)</span><br /></div><br /><span style="color: rgb(0, 0, 0);">which basically preforms a <span class="caps">SELECT</span> * statement, we don&#8217;t like it :)<br /><br />the :counter_cache parameter for the belongs_to macro, indicates the use of a </span></span></span><span style="font-family: arial;"><span style="font-style: italic;">(association_pluralization)</em>count<span style="font-style: italic;"> </span></span>named <span style="font-weight: bold;">column</span> which will be incremented and decremented according to the use of the associative array, this can and does save a lot of time and DB &#8211; <span class="caps">APP</span> &#8211; DB roundup&#8217;s.<br /><br /> </span><br /><span style="font-family: arial;"><span style="color: rgb(204, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="font-style: italic;"><span style="font-style: italic;"></span></span></span></p>
- </div>
- <div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/emphasizedinsanity/embed.js"></script><noscript><a href="http://emphasizedinsanity.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+ <tr>
+ <td>WWR</td>
+ <td class="code"><div><code>{ :working_with_rails => '<a href="http://www.workingwithrails.com/person/5844-elad-meidar">http://www.workingwithrails.com/person/5844-elad-meidar</a>' }</code></div></td>
+ </tr>
+
+ <tr>
+ <td>IRC</td>
+ <td class="code"><div><code>{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#jquery' ]}</code></div></td>
+ </tr>
+ <tr>
+ <td>SKYPE</td>
+ <td class="code"><div>eladmeidar</div></td>
+ </tr>
+ </table>
+ <div class="clear"></div>
+ </div> <!-- /RACK ENV -->
+
+ <div class="stats">
+ <p>
+ <a href="http://feeds2.feedburner.com/EladOnRails"><img src="http://feeds2.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=444444&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
+ <script type="text/javascript" language="javascript" src="http://twittercounter.com/embed/?username=eladmeidar&style=white"></script>
+ </p>
+ <p>
+ <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
+ <noscript>
+ <a href="http://s51.sitemeter.com/stats.asp?site=s51eizesusrulez" target="_top">
+ <img src="http://s51.sitemeter.com/meter.asp?site=s51eizesusrulez" alt="Site Meter" border="0"/></a>
+ </noscript>
+ </p>
+ <div class="clear"></div>
</div>
-</div>
- <div class="push"></div>
- </div>
+ <p id="explanation">You're seeing this error because I think it is funny.</p>
- <div id="footer">
- <div class="site">
- <div class="info">
- <div class="links">
- </div>
- <div class="company">
- <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
- <a href="http://feeds.feedburner.com/EladOnRails"><img src="http://feeds.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=660033&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
- </div>
- </div>
-
- <div class="sponsor">
- <div>
- </div>
- </div>
- </div>
-
-
- <div id="facebox" style="display: none;"> <div class="popup">
- <table> <tbody> <tr> <td
-class="tl"></td><td class="b"></td><td class="tr"></td> </tr>
- <tr> <td class="b"></td> <td
-class="body"> <div class="content"> </div>
- <div class="footer"> <a href="#"
-class="close"> <img src="index_files/closelabel.gif"
- title="close" class="close_image"> </a>
- </div> </td> <td class="b"></td>
- </tr> <tr> <td class="bl"></td><td
-class="b"></td><td class="br"></td> </tr> </tbody>
- </table> </div> </div></body></html>
+ </div> <!-- /WRAP -->
+ </body>
+</html>
View
319 _site/2007/08/connection-options-2/index.html
@@ -1,199 +1,142 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>Emphasized Insanity - Connection Options</title>
- <link href="/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css">
- <link href="/stylesheets/bundle_common.css" media="screen" rel="stylesheet" type="text/css">
- <script type="text/javascript" charset="utf-8">
- var GitHub = {}
- var github_user = 'eladmeidar'
-
- </script>
- <script src="/javascripts/jquery.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_common.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_github.js" type="text/javascript"></script>
- <link href="http://blog.eizesus.com/feed/atom.xml" rel="alternate" title="Emphasized Insanity" type="application/atom+xml">
-
- <meta name="description" content="Ruby on Rails developer blog">
- </head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Emphasized Insanity - Connection Options</title>
+ <script type="text/javascript" src="/javascripts/application.js"></script>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/application.css">
+<link rel="alternate" type="application/rss+xml" title="Emphasized Insanity - Elad Meidar" href="http://feeds.feedburner.com/EladOnRails" />
+</head>
<body>
-
- <div class="subnavd" id="main">
- <div id="header" class="pageheaded">
- <div class="site">
- <div class="logo">
- <a href="/"><h1>Emphasized Insanity</h1></a>
- </div>
- <div class="userbox">
- <div class="inner">
- <div class="avatarname">
- <a href="http://github.com/eladmeidar"><img alt="" src="/images/eladmeidar.jpg" height="20" width="20"></a>
- <a href="http://twitter.com/eladmeidar" class="name">@eladmeidar</a>
- </div>
- <ul class="usernav">
- <li><a href="/about.html">About me</a></li>
- <li><a href="http://www.linkedin.com/in/eladmeidar">LinkedIn</a></li>
- <li><a href="http://workingwithrails.com/person/5844-elad-meidar">WWR</a></li>
- <li><a href="http://github.com/eladmeidar">GitHub</a></li>
- <li><a href="http://www.nautilus6.com">My Company</a></li>
- </ul>
- </div>
- </div><!-- /.userbox -->
- <div class="topsearch">
-
- <form action="http://www.google.com/search?sitename=blog.eizesus.com" id="top_search_form" method="get">
- <input autocomplete="off" class="search my_repos_autocompleter notnative placeholder ac_input" name="q" results="5" placeholder="Search…" type="search"> <input value="Search" class="button" type="submit">
- <input type="hidden" name="sitesearch" value="blog.eizesus.com" checked=""/>
- </form>
-
- <ul class="nav">
- <li><a href="/archive.html">Explore Emphasized Insanity</a></li>
- </ul>
-
- </div>
+ <div id="wrap">
+ <div id="header">
+ <img src="/images/500.png" alt="Emphasized Insanity" />
+ <div id="summary">
+ <h1><strong>EmphasizedInsanity</strong> at <strong>/life
+ </strong></h1>
+ <h2>undefined method `Sanity` for #&lt;EladMeidar::Developer:0x12e0670&gt;</h2>
+ <ul>
+ <li class="first"><strong>file:</strong> <code>
+ brain.rb</code></li>
+ <li><strong>location:</strong> <code>instance_missing
+ </code></li>
+ <li class="last"><strong>line:
+ </strong> 1</li>
+ </ul>
+ </div>
+ <div class="clear"></div>
+ </div>
- </div>
- </div>
- <div class="site">
- <div class="pagehead repohead vis-public">
- <h1> <a href="/">Emphasized Insanity</a> / <strong><a href="/">Blog</a></strong> </h1>
- <ul class="actions">
- <li> <a href="http://blog.eizesus.com/feed/atom.xml" class="minibutton btn-watch " id="watch_button" style=""><span><span class="icon"></span>Subscribe</span></a></li>
- <li class="for-notforked" style=""><a href="#disqus-comments" class="minibutton btn-fork " id="fork_button"><span><span class="icon"></span>Comment</span></a></li>
- </ul>
- <ul class="tabs">
- <li><a href="/" class="selected" highlight="repo_source">Source</a></li>
- <li><a href="/archive.html" highlight="repo_commits">Archive</a></li>
- <li><a href="http://www.railsbridge.org" highlight="issues">RailsBridge</a></li>
- <li class="contextswitch nochoices">
- <span class="toggle leftwards">
- <em>Branch:</em>
- <code>master</code>
- </span>
- </li>
- </ul>
+ <div id="backtrace" class='expanded'>
+ <h3>BACKTRACE</h3>
+ <p><a href="#" id="expando"
+ onclick="toggleBacktrace(); return false">(condense)</a></p>
+ <p id="nav"><strong>JUMP TO:</strong>
+ <a href="#get-info">GET</a>
+ <a href="#post-info">POSTS</a>
+ <a href="#cookie-info">COOKIES</a>
+ <a href="#env-info">ENV</a>
+ </p>
+ <div class="clear"></div>
-<div class="subnav-bar">
- <ul>
- <li>
- <a href="#" class="dropdown">Switch Branches (1)</a>
- <ul>
- <li><strong>master ✓</strong></li>
+ <ul id="backtrace-ul">
+
+ <li class="frame-info framework">
+ <code>
+ No, this is not a real Sinatra error :). <br/>
+ This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).<br/>
+ I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
+ </code>
+ </li>
+ <li class="code framework">
+ </li>
</ul>
- </li>
- </ul>
-</div>
- <div id="repo_details" class="metabox clearfix pledgified">
- <div id="repo_details_loader" class="metabox-loader" style="display: none;">Sending Request…</div>
- <a href="#pledgie_box" rel="facebox" title="Brought to you by pledgie.com" class="pledgie pledgie-button for-owner tooltipped" id="activate_pledgie_button" style="display: none;"><span>Enable Donations</span></a>
- <div id="pledgie_box" style="display: none;">
- <h2>Pledgie Donations</h2>
- </div>
+ </div> <!-- /BACKTRACE -->
+
+ <div id="get">
+<a id="homepage_link" href="/">Back to Posts List</a>
+ <h3 id="get-info">GET</h3>
+ <h3 class="post_title"><a href="/2007/08/connection-options-2">Connection Options</a></h3>
+ <div class="single_post">
+ <p>i found a way to get the connection parameters (other than reading database.yml) of the current database connection.<br /><div id="hlDiv" class="dp-highlighter"><div class="bar"></div><ol class="dp-rb" start="1"><li class="alt"><span><span class="keyword">def</span><span>&nbsp;connection_hash&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;ActiveRecord::Base.connection.instance_variable_get(:<span class="variable">@config_options</span><span>)&nbsp;&nbsp;</span></span></li><li class="alt"><span><span class="keyword">end</span><span>&nbsp;&nbsp;</span></span></li></ol></div></p>
+ </div>
+ <div class="clear"></div>
+</div> <!-- /GET -->
- <div id="repository_description" rel="repository_description_edit">
- <p>
- This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
- </p>
- <p>
- I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).
- </p>
- </div>
- </div>
- </div><!-- /.pagehead -->
- <div id="commit">
- <div class="group">
- <div class="envelope commit">
- <div class="human">
- <div class="message"><pre>Recent Posts</pre></div>
+<div id="post">
+ <h3 id="post-info">POST</h3>
+ <div class="clear"></div>
+</div> <!-- /POST -->
+
+ <div id="cookies">
+ <h3 id="cookie-info">COOKIES</h3>
+
+ <p class="no-data">I Don't have cookies.</p>
+ <div class="clear"></div>
+ </div> <!-- /COOKIES -->
- <div class="actor">
- <div class="gravatar">
- <img alt="" src="images/eladmeidar.jpg" height="30" width="30">
- </div>
- <div class="name"><a href="/">Elad Meidar</a>
- <span>(author)</span>
- </div>
- <div class="date">
- <abbr class="relatize relatized" title="1984-06-19 06:06:07">about 25 years ago</abbr>
- </div>
- </div>
- </div>
- <div class="machine">
- <span>c</span>ommit&nbsp;&nbsp;<a href="#" hotkey="c">60fa264c54341711baef087347105a5b9dd68863</a><br>
- <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" hotkey="t">508268ee6774e5c6060585718705f1ec7afa80d8</a><br>
- <span>p</span>arent&nbsp; <a href="#" hotkey="p">179f7c0440e6073779efc40366c6ced3a9888f71</a>
- </div>
- </div>
+ <div id="rack">
+ <h3 id="env-info">ELAD ENV</h3>
+ <table class="req">
+ <tr>
+ <th>Variable</th>
+ <th>Value</th>
+ </tr>
+
+ <tr>
+ <td>LINKEDIN</td>
+ <td class="code"><div><a href="http://www.linkedin.com/in/eladmeidar">http://www.linkedin.com/in/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>TWITTER</td>
+ <td class="code"><div><a href="http://www.twitter.com/eladmeidar">http://www.twitter.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>FACEBOOK</td>
+ <td class="code"><div><a href="http://www.facebook.com/eladmeidar">http://www.facebook.com/eladmeidar</a></div></td>
+ </tr>
+
+ <tr>
+ <td>GITHUB</td>
+ <td class="code"><div><a href="http://github.com/eladmeidar">http://github.com/eladmeidar</a></div></td>
+ </tr>
- </div>
- </div>
- <div id="path">
- <b><a href="/2007/08/connection-options-2">Connection Options</a></b> /
- </div>
- <div id="browser">
- <table cellpadding="0" cellspacing="0">
- <tbody><tr>
- <th></th>
- <th width="400p">name</th>
- <th>age</th>
- <th>
- history
- </th>
- </tr>
- <tr class="alt">
- <td class="icon"> <img alt="file" src="/images/txt.png"> </td>
- <td class="content">
- <a href="/2007/08/connection-options-2" id="d8f8d46921aa81abc4c0d27703a8908333ae38c3">Connection Options</a>
- </td>
- <td class="age">
- <span class="relatize relatized">29/08/2007</span>
- </td>
- <td class="message">
- <a href="/2007/08/connection-options-2" class="message" title="another post">Another post</a> [Elad Meidar]
- </td>
- </tr>
- </tbody></table>
-</div>
- <div id="readme" class="announce"><span class="name"></span>
- <div class="wikistyle">
- <p>i found a way to get the connection parameters (other than reading database.yml) of the current database connection.<br /><div id="hlDiv" class="dp-highlighter"><div class="bar"></div><ol class="dp-rb" start="1"><li class="alt"><span><span class="keyword">def</span><span>&nbsp;connection_hash&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;ActiveRecord::Base.connection.instance_variable_get(:<span class="variable">@config_options</span><span>)&nbsp;&nbsp;</span></span></li><li class="alt"><span><span class="keyword">end</span><span>&nbsp;&nbsp;</span></span></li></ol></div></p>
- </div>
- <div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/emphasizedinsanity/embed.js"></script><noscript><a href="http://emphasizedinsanity.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+ <tr>
+ <td>WWR</td>
+ <td class="code"><div><code>{ :working_with_rails => '<a href="http://www.workingwithrails.com/person/5844-elad-meidar">http://www.workingwithrails.com/person/5844-elad-meidar</a>' }</code></div></td>
+ </tr>
+
+ <tr>
+ <td>IRC</td>
+ <td class="code"><div><code>{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#jquery' ]}</code></div></td>
+ </tr>
+ <tr>
+ <td>SKYPE</td>
+ <td class="code"><div>eladmeidar</div></td>
+ </tr>
+ </table>
+ <div class="clear"></div>
+ </div> <!-- /RACK ENV -->
+
+ <div class="stats">
+ <p>
+ <a href="http://feeds2.feedburner.com/EladOnRails"><img src="http://feeds2.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=444444&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
+ <script type="text/javascript" language="javascript" src="http://twittercounter.com/embed/?username=eladmeidar&style=white"></script>
+ </p>
+ <p>
+ <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
+ <noscript>
+ <a href="http://s51.sitemeter.com/stats.asp?site=s51eizesusrulez" target="_top">
+ <img src="http://s51.sitemeter.com/meter.asp?site=s51eizesusrulez" alt="Site Meter" border="0"/></a>
+ </noscript>
+ </p>
+ <div class="clear"></div>
</div>
-</div>
- <div class="push"></div>
- </div>
+ <p id="explanation">You're seeing this error because I think it is funny.</p>
- <div id="footer">
- <div class="site">
- <div class="info">
- <div class="links">
- </div>
- <div class="company">
- <script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
- <a href="http://feeds.feedburner.com/EladOnRails"><img src="http://feeds.feedburner.com/~fc/EladOnRails?bg=FFFFFF&amp;fg=660033&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a>
- </div>
- </div>
-
- <div class="sponsor">
- <div>
- </div>
- </div>
- </div>
-
-
- <div id="facebox" style="display: none;"> <div class="popup">
- <table> <tbody> <tr> <td
-class="tl"></td><td class="b"></td><td class="tr"></td> </tr>
- <tr> <td class="b"></td> <td
-class="body"> <div class="content"> </div>
- <div class="footer"> <a href="#"
-class="close"> <img src="index_files/closelabel.gif"
- title="close" class="close_image"> </a>
- </div> </td> <td class="b"></td>
- </tr> <tr> <td class="bl"></td><td
-class="b"></td><td class="br"></td> </tr> </tbody>
- </table> </div> </div></body></html>
+ </div> <!-- /WRAP -->
+ </body>
+</html>
View
319 _site/2007/08/customize-logger-message-format-2/index.html
@@ -1,199 +1,142 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>Emphasized Insanity - Customize Logger message format</title>
- <link href="/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css">
- <link href="/stylesheets/bundle_common.css" media="screen" rel="stylesheet" type="text/css">
- <script type="text/javascript" charset="utf-8">
- var GitHub = {}
- var github_user = 'eladmeidar'
-
- </script>
- <script src="/javascripts/jquery.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_common.js" type="text/javascript"></script>
- <script src="/javascripts/bundle_github.js" type="text/javascript"></script>
- <link href="http://blog.eizesus.com/feed/atom.xml" rel="alternate" title="Emphasized Insanity" type="application/atom+xml">
-
- <meta name="description" content="Ruby on Rails developer blog">
- </head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Emphasized Insanity - Customize Logger message format</title>
+ <script type="text/javascript" src="/javascripts/application.js"></script>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/application.css">
+<link rel="alternate" type="application/rss+xml" title="Emphasized Insanity - Elad Meidar" href="http://feeds.feedburner.com/EladOnRails" />
+</head>
<body>
-
- <div class="subnavd" id="main">
- <div id="header" class="pageheaded">
- <div class="site">
- <div class="logo">
- <a href="/"><h1>Emphasized Insanity</h1></a>
- </div>
- <div class="userbox">
- <div class="inner">
- <div class="avatarname">
- <a href="http://github.com/eladmeidar"><img alt="" src="/images/eladmeidar.jpg" height="20" width="20"></a>
- <a href="http://twitter.com/eladmeidar" class="name">@eladmeidar</a>
- </div>
- <ul class="usernav">
- <li><a href="/about.html">About me</a></li>
- <li><a href="http://www.linkedin.com/in/eladmeidar">LinkedIn</a></li>
- <li><a href="http://workingwithrails.com/person/5844-elad-meidar">WWR</a></li>
- <li><a href="http://github.com/eladmeidar">GitHub</a></li>
- <li><a href="http://www.nautilus6.com">My Company</a></li>
- </ul>
- </div>
- </div><!-- /.userbox -->
- <div class="topsearch">
-
- <form action="http://www.google.com/search?sitename=blog.eizesus.com" id="top_search_form" method="get">
- <input autocomplete="off" class="search my_repos_autocompleter notnative placeholder ac_input" name="q" results="5" placeholder="Search…" type="search"> <input value="Search" class="button" type="submit">
- <input type="hidden" name="sitesearch" value="blog.eizesus.com" checked=""/>
- </form>
-
- <ul class="nav">
- <li><a href="/archive.html">Explore Emphasized Insanity</a></li>
- </ul>
-
- </div>
+ <div id="wrap">
+ <div id="header">
+ <img src="/images/500.png" alt="Emphasized Insanity" />
+ <div id="summary">
+ <h1><strong>EmphasizedInsanity</strong> at <strong>/life
+ </strong></h1>
+ <h2>undefined method `Sanity` for #&lt;EladMeidar::Developer:0x12e0670&gt;</h2>
+ <ul>
+ <li class="first"><strong>file:</strong> <code>
+ brain.rb</code></li>
+ <li><strong>location:</strong> <code>instance_missing
+ </code></li>
+ <li class="last"><strong>line:
+ </strong> 1</li>
+ </ul>
+ </div>
+ <div class="clear"></div>
+ </div>
- </div>
- </div>
- <div class="site">
- <div class="pagehead repohead vis-public">
- <h1> <a href="/">Emphasized Insanity</a> / <strong><a href="/">Blog</a></strong> </h1>
- <ul class="actions">
- <li> <a href="http://blog.eizesus.com/feed/atom.xml" class="minibutton btn-watch " id="watch_button" style=""><span><span class="icon"></span>Subscribe</span></a></li>
- <li class="for-notforked" style=""><a href="#disqus-comments" class="minibutton btn-fork " id="fork_button"><span><span class="icon"></span>Comment</span></a></li>
- </ul>
- <ul class="tabs">
- <li><a href="/" class="selected" highlight="repo_source">Source</a></li>
- <li><a href="/archive.html" highlight="repo_commits">Archive</a></li>
- <li><a href="http://www.railsbridge.org" highlight="issues">RailsBridge</a></li>
- <li class="contextswitch nochoices">
- <span class="toggle leftwards">
- <em>Branch:</em>
- <code>master</code>
- </span>
- </li>
- </ul>
+ <div id="backtrace" class='expanded'>
+ <h3>BACKTRACE</h3>
+ <p><a href="#" id="expando"
+ onclick="toggleBacktrace(); return false">(condense)</a></p>
+ <p id="nav"><strong>JUMP TO:</strong>
+ <a href="#get-info">GET</a>
+ <a href="#post-info">POSTS</a>
+ <a href="#cookie-info">COOKIES</a>
+ <a href="#env-info">ENV</a>
+ </p>
+ <div class="clear"></div>
-<div class="subnav-bar">
- <ul>
- <li>
- <a href="#" class="dropdown">Switch Branches (1)</a>
- <ul>
- <li><strong>master ✓</strong></li>
+ <ul id="backtrace-ul">
+
+ <li class="frame-info framework">
+ <code>
+ No, this is not a real Sinatra error :). <br/>
+ This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).<br/>
+ I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
+ </code>
+ </li>
+ <li class="code framework">
+ </li>
</ul>
- </li>
- </ul>
-</div>
- <div id="repo_details" class="metabox clearfix pledgified">
- <div id="repo_details_loader" class="metabox-loader" style="display: none;">Sending Request…</div>
- <a href="#pledgie_box" rel="facebox" title="Brought to you by pledgie.com" class="pledgie pledgie-button for-owner tooltipped" id="activate_pledgie_button" style="display: none;"><span>Enable Donations</span></a>
- <div id="pledgie_box" style="display: none;">
- <h2>Pledgie Donations</h2>
- </div>
+ </div> <!-- /BACKTRACE -->
+
+ <div id="get">
+<a id="homepage_link" href="/">Back to Posts List</a>
+ <h3 id="get-info">GET</h3>
+ <h3 class="post_title"><a href="/2007/08/customize-logger-message-format-2">Customize Logger message format</a></h3>
+ <div class="single_post">
+ <p><span style="font-family:trebuchet ms;">I Hate these long, frustrating long messages coming out on me when i look at the log. They are long, and needed a refreshing change for my opinion.<br /><br />here is what i found:<br />There is a method which is responsible for the actual <span class="caps">STDOUT</span> printing for the log file, it&#8217;s called <span style="font-weight: bold;">Logger</span>#<span style="font-weight: bold; font-style: italic;">format_message</span>. I decided to overrun it in a more pretty way.<br /><br />I created a /lib library called logger_format<span style="color: rgb(255, 0, 0); font-weight: bold;">.rb </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">and required it in environment.rb,<br /></span></span></span><pre><code class="ruby">&lt;span class="keywords"&gt;&lt;div id="hlDiv" class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;/div&gt;&lt;ol class="dp-rb" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;class&lt;/span&gt;&lt;span&gt; Logger &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt; &lt;span class="keyword"&gt;def&lt;/span&gt;&lt;span&gt; format_message(level, time, progname, msg) &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt; &lt;span class="string"&gt;"#{time.to_s(:long)} -- #{msg}\n"&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt; &lt;span class="keyword"&gt;end&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class="keywords"&gt;&lt;/span&gt;</code></pre>for example.<br />try it out and feel free to modify the output structure at will. <br /><span style="font-family:trebuchet ms;"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /><br /></span></span></span></p>
+ </div>
+ <div class="clear"></div>
+</div> <!-- /GET -->
- <div id="repository_description" rel="repository_description_edit">
- <p>
- This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
- </p>
- <p>
- I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).
- </p>
- </div>
- </div>
- </div><!-- /.pagehead -->