<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Anlek Consulting</title>
	<atom:link href="http://anlek.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://anlek.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 10 Nov 2011 16:29:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Access to the webpage was denied on chrome</title>
		<link>http://anlek.com/2011/11/access-to-the-webpage-was-denied-on-chrome/</link>
		<comments>http://anlek.com/2011/11/access-to-the-webpage-was-denied-on-chrome/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 18:44:56 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://anlek.com/?p=284</guid>
		<description><![CDATA[While working hard at getting an application up and running for a lunch tomorrow, I ran into this annoying screen: Not really reading the message fully, I thought maybe my web server is throwing some sort of error that was telling chrome to stop the request. Quick google for &#8220;Access to the webpage was denied [...]]]></description>
			<content:encoded><![CDATA[<p>While working hard at getting an application up and running for a lunch tomorrow, I ran into this annoying screen:</p>
<p><center><img title="Access to the webpage was denied.jpg" src="http://anlek.com/wp-content/uploads/2011/11/Access-to-the-webpage-was-denied.jpg" alt="Access to the webpage was denied" width="669" height="198" border="0" /></center>Not really reading the message fully, I thought maybe my web server is throwing some sort of error that was telling chrome to stop the request. Quick google for &#8220;Access to the webpage was denied passenger&#8221; didn&#8217;t really return anything useful, however then I remembered that I switched to <a href="http://pow.cx">Pow</a> a while back, so I google again for &#8220;Access to the webpage was denied pow&#8221; but that was even less useful.</p>
<p>So I re-read the message and followed the included link from the message and found this:</p>
<p><center><img title="chrome-net-internals-httpThrottling.jpg" src="http://anlek.com/wp-content/uploads/2011/11/chrome-net-internals-httpThrottling.jpg" alt="Chrome net internals httpThrottling" width="672" height="386" border="0" /></center>Unchecking the checkbox removed this feature.</p>
<h3>Why this happens</h3>
<p>Well it seems that chrome has a built-in DDoS protection, meaning that if a server returns a 500 type error, and you keep refreshing the page to see if it has been fix, chrome will actually stop you for a few second (The exact delay is based on how many times you&#8217;ve attempted to access the page &#8220;<code>delay = initial_backoff * multiply_factor^(effective_failure_count - 1) * Uniform(1 - jitter_factor, 1]</code>&#8220;. Get more info at: http://dev.chromium.org/throttling). This intern stops you from putting extra load on the server while (hopefully) the app is getting fixed.</p>
<h3>Why this is an issue for me</h3>
<p>Now I think it&#8217;s great that chrome attempts to stop (probably unintentional) DDoS attacks, but it should really ensure that local requests don&#8217;t fall under that protection. I am a developer and I&#8217;m trying to fix a local app, which is throwing a 500 error, and I refresh frequently to see if I&#8217;ve been able to fix it but when I am delayed before able to see my results, it&#8217;s just very unproductive, especially when the delay gets longer with the increasing number of refreshes.</p>
<p>That&#8217;s just my thoughts on this. I&#8217;ve already let the Chrome team know about this issue. Let me know if you&#8217;ve had a similar experience.</p>
<h3>UPDATE <em>(Nov 2, 2012)</em></h3>
<p>I just got an email from Jói on the Google Chrome team and he says:</p>
<blockquote><p>From version 13 onwards, Chrome should not throttle any requests to localhost or its many aliases (localhostv6, 127.0.0.1, ::1 and so forth).  You can check your version by typing about:version into the address bar, but it&#8217;s highly likely you are on 14 or later.</p>
<p>On the other hand, it is very difficult for Chrome to distinguish that a domain name or IP address other than the ones universally recognized as being the local loopback address actually points to the local server.</p></blockquote>
<p>And so it seems because I&#8217;m using Pow and my URLs look like http://myapp.dev, chrome is unable to determine if this is a local request and therefore kicks in the DDoS prevention.</p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2011/11/access-to-the-webpage-was-denied-on-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wicked_PDF working in Rails 3.1</title>
		<link>http://anlek.com/2011/09/wicked_pdf-working-in-rails-3-1/</link>
		<comments>http://anlek.com/2011/09/wicked_pdf-working-in-rails-3-1/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 20:29:14 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Wicked_PDF]]></category>
		<category><![CDATA[Rails 3.1]]></category>
		<category><![CDATA[wicked_pdf]]></category>

		<guid isPermaLink="false">http://anlek.com/?p=272</guid>
		<description><![CDATA[I recently updated one of my apps to Rails 3.1 and found that my PDF generating tests were failing because they were unable to find the CSS or images to use in the PDF. So I started playing around, and here is what I got: In your app, add a new initializer (or edit your [...]]]></description>
			<content:encoded><![CDATA[<p>I recently updated one of my apps to Rails 3.1 and found that my PDF generating tests were failing because they were unable to find the CSS or images to use in the PDF.</p>
<p>So I started playing around, and here is what I got:</p>
<p>In your app, add a new initializer (or edit your existing wicked_pdf.rb initializer) and put the following:<br />
<script src="https://gist.github.com/1218149.js?file=wicked_pdf.rb"></script></p>
<p>As you can see in the code, I also replaced the background urls with correct references, this is assuming that you&#8217;re keeping your CSS images in the same location as your normal images (which I don&#8217;t see a reason why not but of course you can always tweak the script)</p>
<h3>Possible Issues</h3>
<h4>Pow.cx</h4>
<p>I had one issue with my generated PDF using <a href="pow.cx">pow.cx</a>, my CPU would jump to 100% (on the pow process) and the page would timeout. After upgrading to the latest version of pow (0.3.2) using this command:</p>
<pre>curl get.pow.cx | sh</pre>
<p>I was able to see my PDFs without an issue.</p>
<h3>Additional Sources:</h3>
<p><a href="http://blog.phusion.nl/2011/08/14/rendering-rails-3-1-assets-to-string/" target="_blank">http://blog.phusion.nl/2011/08/14/rendering-rails-3-1-assets-to-string/</a></p>
<p><a href="https://github.com/mileszs/wicked_pdf/issues/48" target="_blank">https://github.com/mileszs/wicked_pdf/issues/48</a></p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2011/09/wicked_pdf-working-in-rails-3-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cucumber visiting pages using different formats</title>
		<link>http://anlek.com/2011/03/cucumber-visiting-pages-using-different-formats/</link>
		<comments>http://anlek.com/2011/03/cucumber-visiting-pages-using-different-formats/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 19:08:57 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anlek.com/?p=254</guid>
		<description><![CDATA[Ever wonder how you can write a cucumber test that would test how your web app responds to a different format, something like JSON or XML? I was trying to do the following: Background: Given I am logged in And there is the following feeds: &#124; title &#124; body &#124; category &#124; &#124; first feed [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wonder how you can write a cucumber test that would test how your web app responds to a different format, something like JSON or XML?<br />
I was trying to do the following:</p>
<pre>Background:
 Given I am logged in
 And there is the following feeds:
 | title | body | category |
 | first feed | something good | default |
 | second feed | even better | notice |
 | 3rd feed | something awesome | notice |

Scenario: Reading feeds via json
 When I go to the feeds page using json
 And I should see a json file
 And I should see 3 feeds in the json</pre>
<p>Running this code I would get a &#8220;<em>Can&#8217;t find mapping from &#8220;the feeds page using json&#8221; to a path.</em>&#8221;</p>
<p>Trying to figure out how I can do this, I tried to write a new step, like this:</p>
<pre>When %r{^I go to the (w+) page using (w+)$} do |page, format|...</pre>
<p>but this resulted in:<em> Ambiguous match of &#8220;I go to the feeds page using json&#8221;</em></p>
<p>So, I posted the question on<a title="Question on StackOverFlow" href="http://stackoverflow.com/questions/5385676/best-way-to-do-a-visit-step-to-a-page-with-a-different-format-cucumber" target="_blank"> StackOverFlow</a> and it seems everyone was thinking the same way I was.</p>
<p>I continued playing  with this idea and here is how I solved the problem:</p>
<p>Modifying the <strong>paths.rb</strong> file, I changed (Changes are in bold)</p>
<pre><code>def path_to(page_name)
    # Split out format if page_name includes ' using '
    # Example: When I go to the accounts page using json
    <strong>page_name, format = page_name.split(' using ')</strong>
    case page_name

    when /the homes?page/
      '/'
    when /the new account page/
      #pass format
      new_account_path(<strong>:format =&gt; format</strong>)

    else
      begin
        page_name =~ /the (.*) page/
        path_components = $1.split(/s+/)
        # Also make sure to pass format to the 'guessed' path
        self.send(path_components.push('path').join('_').to_sym<strong>, :format =&gt; format</strong>)
      rescue Object =&gt; e
        raise "Can't find mapping from "#{page_name}" to a path.n" +
          "Now, go and add a mapping in #{__FILE__}"
      end
    end
  end
end
</code></pre>
<p>This way I don&#8217;t have to modify anything else in my features and everything just works.</p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2011/03/cucumber-visiting-pages-using-different-formats/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RVM install ruby-1.8.7-p330 fails</title>
		<link>http://anlek.com/2011/01/rvm-install-1-8-7-p330-fails/</link>
		<comments>http://anlek.com/2011/01/rvm-install-1-8-7-p330-fails/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 03:46:49 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[readline]]></category>
		<category><![CDATA[Ruby 1.8.7]]></category>
		<category><![CDATA[RVM]]></category>

		<guid isPermaLink="false">http://anlek.com/?p=241</guid>
		<description><![CDATA[Today I&#8217;m thinking of getting back into so good old work and I read there is a new patch to Ruby, version p330. So I figure that RVM (Ruby Version Manager) being so easy and quick to update, I&#8217;d do the good old &#8220;rvm get head, rvm reload, rvm update 1.8.7&#8243; and I&#8217;m off to [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m thinking of getting back into so good old work and I read there is a new patch to Ruby, version p330. So I figure that <a href="http://rvm.beginrescueend.com/" target="_blank">RVM</a> (Ruby Version Manager) being so easy and quick to update, I&#8217;d do the good old &#8220;rvm get head, rvm reload, rvm update 1.8.7&#8243; and I&#8217;m off to the races.</p>
<p>Well it wasn&#8217;t quite as simple. I ended up with an error:<br />
<code>ruby-1.8.7-p330 - #fetching<br />
ruby-1.8.7-p330 - #extracting ruby-1.8.7-p330 to /Users/andrew/.rvm/src/ruby-1.8.7-p330<br />
ruby-1.8.7-p330 - #extracted to /Users/andrew/.rvm/src/ruby-1.8.7-p330<br />
ruby-1.8.7-p330 - #configuring<br />
ruby-1.8.7-p330 - #compiling<br />
Error running 'make ', please read /Users/andrew/.rvm/log/ruby-1.8.7-p330/make.log<br />
There has been an error while running make. Halting the installation.</code></p>
<p>When I looked into the the make.log, It had this to say:<code><br />
readline.c: In function ‘username_completion_proc_call’:<br />
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)<br />
readline.c:730: error: (Each undeclared identifier is reported only once<br />
readline.c:730: error: for each function it appears in.)</code></p>
<p>So, I figured this was going to take too long to deal with, and moved on to working on my projects. That is till I opened up my project and and did a &#8220;rvm 1.8.7@rails3&#8243; and it come up with:<br />
<code>warn: ruby ruby-1.8.7-p330 is not installed.<br />
To install do: 'rvm install ruby-1.8.7-p330'</code></p>
<p>Great! Now I can&#8217;t upgrade, and I can&#8217;t work with what I have!</p>
<p>Long story short, I figured out that I was missing readline (now I&#8217;m sure I&#8217;ve installed in a long while ago, but I think I was missing the latest version). Also, rvm install readline resulted in an &#8220;<em>Unrecognized command line argument: &#8216;readline&#8217; ( see: &#8216;rvm usage&#8217; )</em>&#8221;</p>
<p>Turns out RVM updated it&#8217;s command to <a href="http://rvm.beginrescueend.com/packages/readline/" target="_blank">install readline</a> to:<br />
<code>rvm package install readline</code></p>
<p><b>Update: (Nov 10, 2011)</b><br />
If you&#8217;re using a newer version of RVM, package has been renamed to pkg, so the command to install readline would be:<br />
<code>rvm pkg install readline</code></p>
<p>However this didn&#8217;t fix my install issue, still got the same error. Luckily I found a <a title="Michael Hartl's tech blog" href="http://blog.mhartl.com/2010/02/19/some-rvm-gotchas/" target="_blank">post</a> that pointed out that my rvm may not know where readline is (odd, as I used rvm to install readline). Running this command allowed me to install it correctly:<br />
<del datetime="2011-01-05T16:46:29+00:00">rvm install 1.8.7 -C &#8211;with-readline-dir=/Users/andrew/.rvm/usr<br />
[Notice: 'andrew' is my username on my mac, yours might be different]</del><br />
<code>rvm install 1.8.7 -C --with-readline-dir=$rvm_path/usr</code></p>
<p>Like always, I&#8217;m hoping this helps some people out.</p>
<p>Let me know if you have any issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2011/01/rvm-install-1-8-7-p330-fails/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>OSX 10.6.5 breaks Apachectl</title>
		<link>http://anlek.com/2010/11/osx-10-6-5-breaks-apachectl/</link>
		<comments>http://anlek.com/2010/11/osx-10-6-5-breaks-apachectl/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 02:32:13 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anlek.com/?p=234</guid>
		<description><![CDATA[Trying to run: sudo apachectl restart Are you getting: /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument Edit your /usr/sbin/apachectl on line 65 from: ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`" to: ULIMIT_MAX_FILES="" and try again. It should now be working agian For more information checkout Deversus]]></description>
			<content:encoded><![CDATA[<p>Trying to run:<br />
<code>sudo apachectl restart</code></p>
<p>Are you getting:<br />
<code>/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument</code></p>
<p>Edit your /usr/sbin/apachectl on line <strong>65 </strong>from:</p>
<p><code>ULIMIT_MAX_FILES=<strong>"</strong><em>ulimit -S -n `ulimit -H -n`</em><strong>"</strong></code></p>
<p>to:</p>
<p><code>ULIMIT_MAX_FILES=<strong>""</strong></code></p>
<p>and try again. It should now be working agian</p>
<p>For more information checkout <a href="http://blog.deversus.com/2010/11/mac-os-1065-apachectl-usrsbinapachectl-line-82-ulimit-open-files-cannot-modify-limit-invalid-argument/" target="_blank">Deversus</a></p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2010/11/osx-10-6-5-breaks-apachectl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog&#8217;s back up! (and a little update about Anlek Consulting)</title>
		<link>http://anlek.com/2010/09/blogs-back-up-and-a-little-update-about-anlek-consulting/</link>
		<comments>http://anlek.com/2010/09/blogs-back-up-and-a-little-update-about-anlek-consulting/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 15:10:27 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.anlek.com/?p=197</guid>
		<description><![CDATA[I&#8217;m happy to say that the blog is back! Sorry for how long we were down but Anlek Consulting has moved offices and the local server (which was running this blog) was taken down and couldn&#8217;t be brought back up. So now we have a new home which should give us a better up time. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to say that the blog is back!</p>
<p>Sorry for how long we were down but Anlek Consulting has moved offices and the local server (which was running this blog) was taken down and couldn&#8217;t be brought back up. So now we have a new home which should give us a better up time.</p>
<p>A little update on what&#8217;s going on at Anlek Consulting. I (Andrew) will be doing a trip around Canada and the USA, hoping to be working on the road with my cell phone and free wifi spots. In light of this, I&#8217;m going to probably blog a bit more about the challenges and adventures of working on the road. Stay tuned for some fun posts!</p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2010/09/blogs-back-up-and-a-little-update-about-anlek-consulting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stripping ASCII colour from a ruby string</title>
		<link>http://anlek.com/2010/06/stripping-ascii-colour-from-a-ruby-string/</link>
		<comments>http://anlek.com/2010/06/stripping-ascii-colour-from-a-ruby-string/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 03:35:01 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[RegEx]]></category>

		<guid isPermaLink="false">http://blog.anlek.com/?p=178</guid>
		<description><![CDATA[I spent a few good hours trying to figure out how to strip a coloured ruby string: which comes out as this: &#62;&#62; p t"2 scenarios (e[33m2 undefinede[0m), 7 steps (e[36m2 skippede[0m, e[33m3 undefinede[0m, e[32m2 passede[0m)"=&#62; nil Now I tried to gsub the string and remove the colour using a RegEx like this: &#62; t.gsub(/\e[(d+)m/, [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a few good hours trying to figure out how to strip a coloured ruby string:</p>
<div  style="width:100%;float:left;">
<p><img src="http://blog.anlek.com/wp-content/uploads/2010/06/coloured-ruby-string.jpg" alt="Coloured Ruby String" width="423" height="32" /></p>
</div>
<p>which comes out as this:</p>
<p><code>&gt;&gt; p t<br />"2 scenarios (e[33m2 undefinede[0m), 7 steps (e[36m2 skippede[0m, e[33m3 undefinede[0m, e[32m2 passede[0m)"<br />=&gt; nil</code></p>
<p>Now I tried to gsub the string and remove the colour using a RegEx like this:</p>
<p><code>&gt; t.gsub(/\e[(d+)m/, "")<br /> =&gt; "2 scenarios (e[33m2 undefinede[0m), 7 steps (e[36m2 skippede[0m, e[33m3 undefinede[0m, e[32m2 passede[0m)"</code></p>
<p>But as you can see, nothing changed. After reading a whole lot of docs on Ruby, Googling around and reading the Ruby String class I came to this conclusion:</p>
<p><code>&gt;&gt; b = "e[33m"<br />=&gt; "e[33m"<br />&gt;&gt; b.each_byte{|c| puts c}<br />27<br />91<br />51<br />51<br />109<br />=&gt; "e[33m"<br />&gt;&gt; "" &lt;&lt; 27 #The only way I know how to add ASCII codes to string<br />=&gt; "e"<br /></code></p>
<p>Now what this allowed me to do is figured out the ASCII code for the e character. However because normally you escape the back slash on regular expressions, once I figured out e was a valid character, I got this:</p>
<p><code>&gt;&gt; "e[33m".gsub(/e[(d+)m/, '')<br /> =&gt; ""</code></p>
<p>I hope this saves someone a few hours!</p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2010/06/stripping-ascii-colour-from-a-ruby-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MongoMapper &#8211; undefined method &#8216;reflect_on_association&#8217;</title>
		<link>http://anlek.com/2010/06/mongomapper-undefined-method-reflect_on_association/</link>
		<comments>http://anlek.com/2010/06/mongomapper-undefined-method-reflect_on_association/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 21:52:52 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[MongoMapper]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://blog.anlek.com/?p=171</guid>
		<description><![CDATA[Information Tidbit: If you&#8217;re using reflection_on_association with ActiveRecord and need to use it with MongoMapper, here is what you want to do: undefined method `reflect_on_association' for User:Class ActiveRecord: User.reflect_on_association(:posts).klass.new MongoMapper: User.associations[:posts].klass.new Mongoid: User.associations['posts'].klass.new notice the posts is a string, it will not work with a symbol UPDATE &#8211; (Apr 2011) Mongoid now follows ActiveRecord&#8217;s style [...]]]></description>
			<content:encoded><![CDATA[<h3>Information Tidbit:</h3>
<p>If you&#8217;re using reflection_on_association with ActiveRecord and need to use it with MongoMapper, here is what you want to do:</p>
<p><code>undefined method `reflect_on_association' for User:Class</code></p>
<p>ActiveRecord:<br />
<code>User.reflect_on_association(:posts).klass.new</code></p>
<p>MongoMapper:<br />
<code>User.associations[:posts].klass.new</code></p>
<p>Mongoid:</p>
<p><code>User.associations['posts'].klass.new</code><br />
<em>notice the posts is a string, it will not work with a symbol</em></p>
<p><strong>UPDATE &#8211; (Apr 2011) </strong>Mongoid now follows ActiveRecord&#8217;s style naming:</p>
<p><code>User.reflect_on_association(:posts).klass.new</code></p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2010/06/mongomapper-undefined-method-reflect_on_association/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Paperclip to work with MongoMapper</title>
		<link>http://anlek.com/2010/06/getting-paperclip-to-work-with-mongomapper/</link>
		<comments>http://anlek.com/2010/06/getting-paperclip-to-work-with-mongomapper/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 17:17:04 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[MongoMapper]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[paperclip]]></category>

		<guid isPermaLink="false">http://blog.anlek.com/?p=161</guid>
		<description><![CDATA[Last night I was trying really hard to get MongoMapper to work with Paperclip via GridFS and failed. It seems right now Paperclip or even CarrierWave are not ready to be used with the latest MongoMapper drivers and GridFS (and I needed to use the latest drivers due to Scopify). After giving up using GridFS, [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I was trying really hard to get MongoMapper to work with Paperclip via GridFS and failed. It seems right now <a href="http://github.com/thoughtbot/paperclip" target="_blank">Paperclip</a> or even <a href="http://github.com/jnicklas/carrierwave" target="_blank">CarrierWave</a> are not ready to be used with the latest MongoMapper drivers and GridFS (and I needed to use the latest drivers due to <a href="http://github.com/grosser/scopify" target="_blank">Scopify</a>).</p>
<p>After giving up using GridFS, I wanted to use Paperclip with MongoMapper with the normal file system and I found this <a title="Paperclip and MongoMapper" href="http://www.bencurtis.com/2009/08/paperclip-and-mongomapper/" target="_blank">article from Ben Curtis</a>, however with the latest version of Paperclip (version 2.3.1.1) and MongoMapper (version 0.7.6) I was unsuccessful, kept getting:</p>
<p><code>Anonymous modules have no name to be referenced by</code></p>
<p>After reading the backtrace and diving into the paperclip source code I noticed that it was trying to use the ActiveRecord.logger and since I&#8217;ve removed ActiveRecord from my app, it was failing (with the odd error).</p>
<p>After some tweaking of Ben&#8217;s code, I came up with this: <a href="http://gist.github.com/424158" target="_blank">http://gist.github.com/424158</a></p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2010/06/getting-paperclip-to-work-with-mongomapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MongoMapper logging to Rails log</title>
		<link>http://anlek.com/2010/05/mongomapper-logging-to-rails-log/</link>
		<comments>http://anlek.com/2010/05/mongomapper-logging-to-rails-log/#comments</comments>
		<pubDate>Mon, 17 May 2010 01:35:12 +0000</pubDate>
		<dc:creator>Andrew Kalek</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[MongoMapper]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://blog.anlek.com/?p=152</guid>
		<description><![CDATA[I started playing around with MongoMapper for MongoDB and I have to say I&#8217;m loving it! Somehow it just feels so much easier to work with. However, I did have an issue with my code and needed to see whether or not MongoMapper was looking for account_id in my model. Since there is no sql [...]]]></description>
			<content:encoded><![CDATA[<p>I started playing around with <a title="MongoMapper Github page" href="http://github.com/jnunemaker/mongomapper" target="_blank">MongoMapper</a> for <a title="MongoDB Main Page" href="http://mongodb.org" target="_blank">MongoDB</a> and I have to say I&#8217;m loving it! Somehow it just feels so much easier to work with. However, I did have an issue with my code and needed to see whether or not MongoMapper was looking for account_id in my model. Since there is no sql to look at, I was looking for a way to see what MongoMapper was sending to MongoDB. Luckily the answer was very simple, in your connection string you just have to do this:</p>
<p><code>MongoMapper.connection = Mongo::Connection.new('localhost', 27017, :logger =&gt; Rails.logger)</code></p>
<p>This little tidbit came from <a title="Zyph | Martin Design Studios, LLC :: Blog :: MongoDB and MongoMapper Greatness" href="http://www.zyphmartin.com/blog/mongodb-and-mongomapper-greatness" target="_blank">Zyph blog post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://anlek.com/2010/05/mongomapper-logging-to-rails-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

