<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.binarylogic.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://www.binarylogic.com/wp-atom.php">
	<title type="text">Binary Logic</title>
	<subtitle type="text">Ben Johnson's thoughts and programming techniques</subtitle>

	<updated>2010-01-23T21:19:58Z</updated>
	<generator uri="http://wordpress.org/" version="2.8">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://www.binarylogic.com" />
	<id>http://feeds.binarylogic.com/binarylogic</id>
	

			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.binarylogic.com/binarylogic" /><feedburner:info uri="binarylogic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Polymorphic association support added to searchlogic]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/9oaioaXd-z0/" />
		<id>http://www.binarylogic.com/?p=839</id>
		<updated>2010-01-23T21:19:58Z</updated>
		<published>2010-01-23T21:19:58Z</published>
		<category scheme="http://www.binarylogic.com" term="Searchlogic" /><category scheme="http://www.binarylogic.com" term="polymorphic" />		<summary type="html"><![CDATA[If you have ever worked with polymorphic associations you know that using them in a search can be a pain in the ass. Rightfully so, because a polymorphic association is ambiguous, in order for ActiveRecord to do its magic with creating joins it needs more information that it can&#8217;t get. Such as, are you wanting [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2010/01/23/polymorphic-association-support-added-to-searchlogic/">&lt;p&gt;If you have ever worked with polymorphic associations you know that using them in a search can be a pain in the ass. Rightfully so, because a polymorphic association is ambiguous, in order for ActiveRecord to do its magic with creating joins it needs more information that it can&amp;#8217;t get. Such as, are you wanting to search type A or type B? In my projects I&amp;#8217;ve been dealing with this by writing my own named scopes with my own joins. Not a big deal. But here&amp;#8217;s the problem&amp;#8230;.&lt;/p&gt;
&lt;p&gt;My favorite feature in Searchlogic is named scope delegation. I&amp;#8217;ve noticed in a number of projects I&amp;#8217;ve seen where programmers copy over named scope logic into related models. Which makes sense, because AR gives you no way of easily accessing related scopes. For example:&lt;/p&gt;
&lt;pre&gt;
Order.named_scope :pending, :conditions =&gt; {:state =&gt; "pending"}
User.named_scope :pending_orders, :joins =&gt; :orders, :conditions =&gt; "orders.state = 'pending'"
&lt;/pre&gt;
&lt;p&gt;Most people would look at that and never see anything wrong with it. What is the conditions for a pending order changes?&lt;/p&gt;
&lt;pre&gt;
Order.named_scope :pending, :conditions =&gt; "orders.state = 'pending' AND approved = true
&lt;/pre&gt;
&lt;p&gt;Now you have to remember to change this logic in associated models. This is a programming no-no. With searchlogic you don&amp;#8217;t even need to touch the User model. You can access the order&amp;#8217;s named scope, and it delegates that call:&lt;/p&gt;
&lt;pre&gt;
User.orders_pending
&lt;/pre&gt;
&lt;p&gt;Now when you change what defines an order as pending it will change everywhere in your application. This is great, but where this feature comes to a screeching halt is when you encounter a polymorphic association. This is because AR has no internal support for this either. For example, you can&amp;#8217;t do:&lt;/p&gt;
&lt;pre&gt;
Audit.belongs_to :auditable, :polymorphic =&gt; true
User.has_many :audits, :as =&gt; :auditable

Audit.all(:joins =&gt; :user)
&lt;/pre&gt;
&lt;p&gt;Obviously the above won&amp;#8217;t work. AR has no idea that there is a relationship with users through the polymorphic auditable relationship. To overcome this you have to write your own join. Again, there is nothing wrong with writing SQL, I don&amp;#8217;t want to send the wrong message. The problem is that you are back to square one with my named scope delegation problem above. To solve this I added a way to overcome this. With searchlogic you could do this:&lt;/p&gt;
&lt;pre&gt;
Audit.auditable_user_type_name_like("ben")
&lt;/pre&gt;
&lt;p&gt;Searchlogic will take care of creating the join on the polymorphic relationship and then delegate the call to the User.name_like named_scope. I think it&amp;#8217;s pretty nifty.&lt;/p&gt;
&lt;p&gt;I hope I explained this well. I figured I would mention the new feature because I&amp;#8217;m sure I&amp;#8217;m not the only person that has encountered this problem.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Polymorphic%20association%20support%20added%20to%20searchlogic&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2010%2F01%2F23%2Fpolymorphic-association-support-added-to-searchlogic%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eCwlILRZ2W-RcZdxpKyUOark3eY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eCwlILRZ2W-RcZdxpKyUOark3eY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eCwlILRZ2W-RcZdxpKyUOark3eY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eCwlILRZ2W-RcZdxpKyUOark3eY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/9oaioaXd-z0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2010/01/23/polymorphic-association-support-added-to-searchlogic/#comments" thr:count="6" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2010/01/23/polymorphic-association-support-added-to-searchlogic/feed/atom/" thr:count="6" />
		<thr:total>6</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2010/01/23/polymorphic-association-support-added-to-searchlogic/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Using Geokit with Searchlogic]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/Ni4PcVsWKqg/" />
		<id>http://www.binarylogic.com/?p=832</id>
		<updated>2010-01-11T08:30:34Z</updated>
		<published>2010-01-10T03:06:21Z</published>
		<category scheme="http://www.binarylogic.com" term="Searchlogic" /><category scheme="http://www.binarylogic.com" term="geokit" />		<summary type="html"><![CDATA[For those of you that don&#8217;t know, geokit is a great little gem that allows you to geocode addresses. It adds in very easy to use options in the ActiveRecord find method. Ex:

# will return all venues within 10 miles of the 10018 zip code
Venue.find(:all, :origin => "10018", :within => 10)

The problem is that you [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2010/01/09/using-geokit-with-searchlogic/">&lt;p&gt;For those of you that don&amp;#8217;t know, &lt;a href="http://github.com/andre/geokit-gem"&gt;geokit&lt;/a&gt; is a great little gem that allows you to geocode addresses. It adds in very easy to use options in the ActiveRecord find method. Ex:&lt;/p&gt;
&lt;pre&gt;
# will return all venues within 10 miles of the 10018 zip code
Venue.find(:all, :origin =&gt; "10018", :within =&gt; 10)
&lt;/pre&gt;
&lt;p&gt;The problem is that you can&amp;#8217;t use geokit options in a named scope. Since searchlogic is named scope driven this presented a problem. So I wrote a little module that transfers geokit options from named scopes to the actual arguments of the method:&lt;/p&gt;
&lt;pre class="ruby"&gt;
module GeokitForNamedScopes
  OPTIONS = [:origin, :within, :beyond, :range, :formula, :bounds]

  def find(*args)
    super(*transfer_from_scope_to_args(args))
  end

  def count(*args)
    super(*transfer_from_scope_to_args(args))
  end

  private
    def transfer_from_scope_to_args(args)
      find_options = scope(:find)
      if find_options.is_a?(Hash)
        options = args.extract_options!
        OPTIONS.each do |key|
          options[key] = find_options.delete(key) if find_options.key?(key)
        end
        args &lt;&lt; options
      else
        args
      end
    end
end

class ActiveRecord::Base
  class &lt;&lt; self
    def acts_as_mappable(*args)
      result = super(*args)
      extend GeokitForNamedScopes

      GeokitForNamedScopes::OPTIONS.each do |key|
        named_scope key, lambda { |value| {key =&gt; value} }
      end

      result
    end

    VALID_FIND_OPTIONS += GeokitForNamedScopes::OPTIONS
  end
end
&lt;/pre&gt;
&lt;p&gt;It&amp;#8217;s far from perfect. The glaring problem is obviously redefining the VALID_FIND_OPTIONS constant, which throws a warning. But it works and it&amp;#8217;s good enough for now. If anyone has any suggestions on how to improve this I&amp;#8217;d to hear them. But you should be able to use geokit options in a named_scope with the above code. Ex:&lt;/p&gt;
&lt;pre&gt;
Venue.origin("10017").within(10).all # =&gt; will return all venues within 10 miles of 10017
&lt;/pre&gt;
&lt;h2&gt;Using this through associations&lt;/h2&gt;
&lt;p&gt;Geokit doesn&amp;#8217;t really support making these calls through associations. But if you read the &lt;a href="http://github.com/andre/geokit-rails"&gt;documentation&lt;/a&gt;. You will notice they do support this:&lt;/p&gt;
&lt;pre&gt;
acts_as_mappable :through =&gt; :whatever
&lt;/pre&gt;
&lt;p&gt;You can use that feature to bridge the gap&lt;/p&gt;
&lt;p&gt;Hopefully this helps some of you.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Using%20Geokit%20with%20Searchlogic&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2010%2F01%2F09%2Fusing-geokit-with-searchlogic%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/L7k2N5Tn0KpuKuYibLyzp44baJY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L7k2N5Tn0KpuKuYibLyzp44baJY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/L7k2N5Tn0KpuKuYibLyzp44baJY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L7k2N5Tn0KpuKuYibLyzp44baJY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/Ni4PcVsWKqg" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2010/01/09/using-geokit-with-searchlogic/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2010/01/09/using-geokit-with-searchlogic/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2010/01/09/using-geokit-with-searchlogic/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Interview for railscoach.com]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/MV49loUOQ-U/" />
		<id>http://www.binarylogic.com/?p=830</id>
		<updated>2010-01-10T00:03:02Z</updated>
		<published>2010-01-10T00:03:02Z</published>
		<category scheme="http://www.binarylogic.com" term="General" />		<summary type="html"><![CDATA[I just got done doing an interview with Charles Wood at Rails Coach. Check it out if you are interested. Man I hate hearing myself talk.
]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2010/01/09/interview-for-railscoach-com/">&lt;p&gt;I just got done doing an &lt;a href="http://railscoach.com/episode-4-interview-with-ben-johnson-binarylogic/"&gt;interview with Charles Wood&lt;/a&gt; at &lt;a href="http://www.railscoach.com"&gt;Rails Coach&lt;/a&gt;. Check it out if you are interested. Man I hate hearing myself talk.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Interview%20for%20railscoach.com&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2010%2F01%2F09%2Finterview-for-railscoach-com%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PRKLNkdoy7SbG6gg-_wMO0DP6r8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PRKLNkdoy7SbG6gg-_wMO0DP6r8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PRKLNkdoy7SbG6gg-_wMO0DP6r8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PRKLNkdoy7SbG6gg-_wMO0DP6r8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/MV49loUOQ-U" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2010/01/09/interview-for-railscoach-com/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2010/01/09/interview-for-railscoach-com/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2010/01/09/interview-for-railscoach-com/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Great marketing or a great product?]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/35ZoqsySYQw/" />
		<id>http://www.binarylogic.com/?p=823</id>
		<updated>2009-12-08T08:41:13Z</updated>
		<published>2009-12-08T03:41:25Z</published>
		<category scheme="http://www.binarylogic.com" term="Uncategorized" /><category scheme="http://www.binarylogic.com" term="marketing business" />		<summary type="html"><![CDATA[I know this post is kind of out of the norm, but what the hell, I figured I would let it fly. Today I was thinking a lot about business and what makes a company successful. I was thinking specifically about marketing and I came up with an interesting scenario:
Say you had money to invest [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/12/07/great-marketing-or-a-great-product/">&lt;p&gt;I know this post is kind of out of the norm, but what the hell, I figured I would let it fly. Today I was thinking a lot about business and what makes a company successful. I was thinking specifically about marketing and I came up with an interesting scenario:&lt;/p&gt;
&lt;p&gt;Say you had money to invest and you had to pick one of these companies to invest in. Both companies are in new industries that have pretty good potential for growth. Which one would you pick?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A company that clearly has the best product, but has an average or below average marketing strategy.&lt;/li&gt;
&lt;li&gt;A company with an average or below average product, but has an outstanding marketing strategy.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The above facts are set in stone. You can&amp;#8217;t say you would change their marketing strategy or improve their product. You had to pick one of the companies given the current facts above, with no assumptions as to what can or might happen in the future.&lt;/p&gt;
&lt;p&gt;I am also aware that if you were actually investing into a company you would require much more information, and there are a number of factors that would sway your decision. But setting that all aside, and you had to pick one right now given the above information, which one would you pick?&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Great%20marketing%20or%20a%20great%20product%3F&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F12%2F07%2Fgreat-marketing-or-a-great-product%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Wj-JMO_n7QKzCIj2SvOC5l_DeSU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wj-JMO_n7QKzCIj2SvOC5l_DeSU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Wj-JMO_n7QKzCIj2SvOC5l_DeSU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wj-JMO_n7QKzCIj2SvOC5l_DeSU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/35ZoqsySYQw" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/12/07/great-marketing-or-a-great-product/#comments" thr:count="9" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/12/07/great-marketing-or-a-great-product/feed/atom/" thr:count="9" />
		<thr:total>9</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/12/07/great-marketing-or-a-great-product/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Authlogic: keeping you in the loop]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/znXlBOwWtT8/" />
		<id>http://www.binarylogic.com/?p=820</id>
		<updated>2009-11-21T22:17:43Z</updated>
		<published>2009-11-21T22:17:43Z</published>
		<category scheme="http://www.binarylogic.com" term="Authlogic" /><category scheme="http://www.binarylogic.com" term="authentication" /><category scheme="http://www.binarylogic.com" term="v3" />		<summary type="html"><![CDATA[I figured I would post an update keeping everyone in the loop. I created a new branch for authlogic locally and I&#8217;ve been making some changes mentioned in this post. Some of the changes I&#8217;m making are still somewhat experimental and I&#8217;m playing around with the code to see if I like the end result. [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/11/21/authlogic-keeping-you-in-the-loop/">&lt;p&gt;I figured I would post an update keeping everyone in the loop. I created a new branch for authlogic locally and I&amp;#8217;ve been making some changes mentioned &lt;a href="http://www.binarylogic.com/2009/08/13/authlogic-ideas/"&gt;in this post&lt;/a&gt;. Some of the changes I&amp;#8217;m making are still somewhat experimental and I&amp;#8217;m playing around with the code to see if I like the end result. Figuring out a way to make this ORM agnostic has proven difficult, simply because there is no standard. They all follow a similar pattern, but the method naming conventions and some of the feature implementations are vastly different. I&amp;#8217;m also not sure you could even set a standard. Regardless, I do think this is an important feature since there is a lot of movement around alternative storage solutions such as MongoDB, CouchDB, etc.&lt;/p&gt;
&lt;p&gt;Splitting out some of the authentication code into &amp;#8220;authenticators&amp;#8221; has worked out great so far. More importantly, its more or less a blueprint for people to extend Authlogic and provide alternate authentication solutions (openid, facebook connect, oauth, etc.).&lt;/p&gt;
&lt;p&gt;The last major change I&amp;#8217;ve been making is removing validations in the acts_as_authentic module. Validations add some clutter to authlogic, some might say its a necessary clutter, but I&amp;#8217;m leaning towards leaving it out. Validation is such an easy thing to do. ActiveRecord provides very simple methods for doing this, I also feel like its gets in the way for certain edge cases. Authlogic will still provide some nice methods to make your life easier, like validating the format of an email address, the main difference being that you have to explicitly implement this validation. No validations will be automatically added. Lastly, this makes ORM abstraction a little easier.&lt;/p&gt;
&lt;p&gt;So that&amp;#8217;s that. I&amp;#8217;ll keep you updated when I start to push out some code and what not. I&amp;#8217;m probably going to label this release as v3, because of the validation changes and some of the other major changes that might break backwards compatibility.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Authlogic%3A%20keeping%20you%20in%20the%20loop&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F11%2F21%2Fauthlogic-keeping-you-in-the-loop%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/f0IB4q1EkJe6Csvy2EwiwB-Wk6o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f0IB4q1EkJe6Csvy2EwiwB-Wk6o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/f0IB4q1EkJe6Csvy2EwiwB-Wk6o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f0IB4q1EkJe6Csvy2EwiwB-Wk6o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/znXlBOwWtT8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/11/21/authlogic-keeping-you-in-the-loop/#comments" thr:count="5" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/11/21/authlogic-keeping-you-in-the-loop/feed/atom/" thr:count="5" />
		<thr:total>5</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/11/21/authlogic-keeping-you-in-the-loop/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Work with yours truly]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/JCfn-LXDHuM/" />
		<id>http://www.binarylogic.com/?p=817</id>
		<updated>2009-11-17T07:52:50Z</updated>
		<published>2009-11-17T07:52:20Z</published>
		<category scheme="http://www.binarylogic.com" term="General" /><category scheme="http://www.binarylogic.com" term="hire" /><category scheme="http://www.binarylogic.com" term="job" />		<summary type="html"><![CDATA[My company Concierge Live is looking for another programmer. We are growing very fast and doing well. We have a great product that currently leads the industry, as well as great ideas and features that are waiting to be developed, which is where you come in. You would be working primarily with me. Our focus [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/11/17/work-with-yours-truly/">&lt;p&gt;My company &lt;a href="http://www.conciergelive.com"&gt;Concierge Live&lt;/a&gt; is looking for another programmer. We are growing very fast and doing well. We have a great product that currently leads the industry, as well as great ideas and features that are waiting to be developed, which is where you come in. You would be working primarily with me. Our focus is on your talent and the code you write. As such, our requirements are pretty lax. You have the option to work remotely or at our offices, you can work full time or part time, and you will have big impact on the direction and success of the software.&lt;/p&gt;
&lt;p&gt;Everything you would normally think of are included in this job. A great salary, benefits, etc. I&amp;#8217;m also not a big fan of resumes or other formal job requirements. I just want to talk with you and see some of your work. So, before you contact me have some sort of portfolio and code examples ready.&lt;/p&gt;
&lt;p&gt;Shoot me an email if you are interested, I&amp;#8217;d love to talk: bjohnson [a t] binarylogic.com&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Work%20with%20yours%20truly&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F11%2F17%2Fwork-with-yours-truly%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eAaiYiKVdC_SlCgetoxwAzjzRpw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eAaiYiKVdC_SlCgetoxwAzjzRpw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eAaiYiKVdC_SlCgetoxwAzjzRpw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eAaiYiKVdC_SlCgetoxwAzjzRpw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/JCfn-LXDHuM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/11/17/work-with-yours-truly/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/11/17/work-with-yours-truly/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/11/17/work-with-yours-truly/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Discontinuing Resourcelogic]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/aDMJvrWnSfE/" />
		<id>http://www.binarylogic.com/?p=805</id>
		<updated>2009-10-06T04:33:08Z</updated>
		<published>2009-10-06T04:31:47Z</published>
		<category scheme="http://www.binarylogic.com" term="Resourcelogic" /><category scheme="http://www.binarylogic.com" term="discontinuing" /><category scheme="http://www.binarylogic.com" term="resources" />		<summary type="html"><![CDATA[Lately I&#8217;ve been really going back and forth between using tools like resourcelogic, inherited_resources, resource_controller, etc. And I gave each one of these libraries a more than fair shot. I&#8217;ve used all of them extensively, that&#8217;s the whole reason I created resourcelogic to begin with. I really liked resource_controller, so much that I decided to [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/10/06/discontinuing-resourcelogic/">&lt;p&gt;Lately I&amp;#8217;ve been really going back and forth between using tools like &lt;a href="http://github.com/binarylogic/resourcelogic"&gt;resourcelogic&lt;/a&gt;, &lt;a href="http://github.com/josevalim/inherited_resources"&gt;inherited_resources&lt;/a&gt;, &lt;a href="http://github.com/giraffesoft/resource_controller"&gt;resource_controller&lt;/a&gt;, etc. And I gave each one of these libraries a more than fair shot. I&amp;#8217;ve used all of them extensively, that&amp;#8217;s the whole reason I created resourcelogic to begin with. I really liked resource_controller, so much that I decided to take it and kind of make my own version called resourcelogic. I ended up changing it quite a bit, and it worked out well, but it got out of hand. So I&amp;#8217;m going to address why I advise against using libraries like this:&lt;br /&gt;
&lt;span id="more-805"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Deviating from standards makes it harder to work with other programmers&lt;/h2&gt;
&lt;p&gt;You have to think that certain things in rails are there for a reason. Rails is a result of thousands of programmer&amp;#8217;s ideas, its used by extensively by programming teams large and small, and has tremendous success. There is a reason for that. Chances are, you aren&amp;#8217;t going to sit around one day and come up with this idea that takes rails to the next level. I&amp;#8217;m not trying to be a Debbie Downer and tell people not to try and improve rails or be innovative. That&amp;#8217;s not the message I&amp;#8217;m trying to send here. What I&amp;#8217;m trying to say is that if you are sitting around and you come up with this crazy idea that deviates quite a bit from the rails standards, it&amp;#8217;s probably wrong, even if you think it&amp;#8217;s cool. I thought I did that with resourcelogic. I thought I was Mr. Awesome and I came up with this new development style for rails that was better than anything done before. I know that sounds pretty conceited but I was on my high horse. I thought the development style behind resourcelogic was awesome and I was going to share it with the rails community and people were going to eat it up.&lt;/p&gt;
&lt;p&gt;So I ran with it, I developed an entire project with it by myself. Probably the most important project I&amp;#8217;ve ever developed. I gave all of these libraries a more than fair shot. In the end, it made my project more confusing. The red flag was showing my code to another programmer. I had to explain what was going on and he was still kind of confused. Once he got it, he didn&amp;#8217;t like it. This is not good. I didn&amp;#8217;t like the thought of having to go through this with every programmer I was going to hire for this project. Which leads me to my next point:&lt;/p&gt;
&lt;h2&gt;You lose intent&lt;/h2&gt;
&lt;p&gt;This is probably my biggest complaint: you lose intent. There is a lot of code hidden away, so when you see small controllers with 4 &amp;#8211; 5 lines of code providing all of this application specific functionality it kind of makes you wonder what is going on. There is no direct intent saying &amp;#8220;this is what I&amp;#8217;m doing&amp;#8221;. There&amp;#8217;s a lot of magic. My controllers looked like this:&lt;/p&gt;
&lt;pre class="ruby"&gt;
create.before { ... }
create.wants.xml { ... }
create.wants.js { ... }
create.after { ... }
index.before { ... }

def my_own_custom_action
...
end
&lt;/pre&gt;
&lt;p&gt;It just felt wrong. There is something refreshing about seeing this:&lt;/p&gt;
&lt;pre class="ruby"&gt;
def create
  @user = User.new(params[:user])
  respond_to do |wants|
    if @user.save
      wants.html { redirect_to users_url }
      wants.js { render :inline =&gt; "window.location = '&lt;%= users_url %&gt;';" }
   else
     wants.html { render :action =&gt; :new }
     wants.js { ... }
   end
  end
end
&lt;/pre&gt;
&lt;p&gt;Is that more code? Yes. Who said more code is bad when it makes more sense? I can look at the create method and know EXACTLY what is going on. I can add in some weird edge case if I need. I can do whatever the hell I want and I&amp;#8217;m not confined to the standards set in resourcelogic. I don&amp;#8217;t feel like I&amp;#8217;m deviating from a pattern by doing that either. Sure, with resourcelogic you can write your own create method, but then I feel dirty, like I&amp;#8217;m not following the pattern my application has defined.&lt;/p&gt;
&lt;h2&gt;Upgrading rails&lt;/h2&gt;
&lt;p&gt;What example would you feel more comfortable with if you were upgrading from rails 2 to 3? The one that uses a pattern that deviates from the rails standards, or one that uses the most basic of rails code? I would feel better with the second. That is standard rails code that I know for a 100% fact is going to be supported in Rails 3. Sure, you could up date the library in the first example to work with rails 3, but in my opinion thats a sign the library is messing with code it shouldn&amp;#8217;t.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;m not trying to knock libraries like resource_controller or inherited_resources, hell I wrote my own version called resourcelogic. So I would be knocking myself if I did. I just don&amp;#8217;t think they are needed. Rails is simple to begin with. There is nothing wrong with writing out a full controller method. It&amp;#8217;s simple, its direct, its clear, and it follows the rails standards. I can pick any programmer from the rails community and not have to say a word and they would understand a standard rails action. While at the same time I could show them a &amp;#8220;resource controller&amp;#8221; and a lot of people would wonder what the hell is going on. More importantly, edge cases feel clean. If a controller needs to do something a little bit different, that&amp;#8217;s fine. I have full control of what is going on. I don&amp;#8217;t have to use some weird API with before and after hooks to add in edge cases.&lt;/p&gt;
&lt;p&gt;So the bottom line is that I am stopping support for resourcelogic. I will more than likely remove it from github because I don&amp;#8217;t want to send people down the wrong path thinking its a good tool to use. For a simple project its probably fine, but in the end it&amp;#8217;s just not worth it. All of the time and effort I spent writing resourcelogic and implementing it into my app was kind of a waste. With that time I could have made some major advancements and improvements to my application. But it&amp;#8217;s things like this that make you a better programmer, you live and you learn. The lesson I learned is to not deviate from the rails standards too much. Use what they give you, chances are it will work out just fine because there are thousands of other programmers using the same tools to build a large variety of projects.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Discontinuing%20Resourcelogic&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F10%2F06%2Fdiscontinuing-resourcelogic%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eR9QVFDWrLKeejb4sUlevxwWtP8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eR9QVFDWrLKeejb4sUlevxwWtP8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eR9QVFDWrLKeejb4sUlevxwWtP8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eR9QVFDWrLKeejb4sUlevxwWtP8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/aDMJvrWnSfE" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/10/06/discontinuing-resourcelogic/#comments" thr:count="24" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/10/06/discontinuing-resourcelogic/feed/atom/" thr:count="24" />
		<thr:total>24</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/10/06/discontinuing-resourcelogic/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Apologies to those needing help with my libraries]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/WkJl8NQumpI/" />
		<id>http://www.binarylogic.com/?p=801</id>
		<updated>2009-09-02T05:01:30Z</updated>
		<published>2009-09-02T04:56:48Z</published>
		<category scheme="http://www.binarylogic.com" term="General" />		<summary type="html"><![CDATA[I wanted to make a post about this. I&#8217;ve been extremely busy with my job lately. I&#8217;m launching a new company, and as we approach launch date it seems to get more hectic. I&#8217;ve got quite a few messages in my github account, email, google groups, etc. I usually try to block out about an [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/09/02/apologies-to-those-needing-help-with-my-libraries/">&lt;p&gt;I wanted to make a post about this. I&amp;#8217;ve been extremely busy with my job lately. I&amp;#8217;m launching a new company, and as we approach launch date it seems to get more hectic. I&amp;#8217;ve got quite a few messages in my github account, email, google groups, etc. I usually try to block out about an hour a day answering emails and performing basic chores with my open source projects, but I literally haven&amp;#8217;t had an hour to spare. The time that I do have is spent maintaining my open source projects, so solving individual problems has been put on hold for now. I apologize if I haven&amp;#8217;t responded to you. Don&amp;#8217;t take it as an insult, I am just very busy right now. If you need help, please use google groups, the people on there are very helpful. By the way, thanks to everyone on google groups, github, Ryan Bates on railscasts, etc, for helping out. You guys really have been a big help, this is why I love open source.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Apologies%20to%20those%20needing%20help%20with%20my%20libraries&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F09%2F02%2Fapologies-to-those-needing-help-with-my-libraries%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2btRNfqJ-NUcZmPrCy5rHxo76uk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2btRNfqJ-NUcZmPrCy5rHxo76uk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2btRNfqJ-NUcZmPrCy5rHxo76uk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2btRNfqJ-NUcZmPrCy5rHxo76uk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/WkJl8NQumpI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/09/02/apologies-to-those-needing-help-with-my-libraries/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/09/02/apologies-to-those-needing-help-with-my-libraries/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/09/02/apologies-to-those-needing-help-with-my-libraries/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Using Searchlogic to combine named scopes with &#8216;OR&#8217;]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/sMKQa2i_uOE/" />
		<id>http://www.binarylogic.com/?p=796</id>
		<updated>2009-08-26T08:21:47Z</updated>
		<published>2009-08-26T07:47:14Z</published>
		<category scheme="http://www.binarylogic.com" term="Searchlogic" /><category scheme="http://www.binarylogic.com" term="named scope procedure" /><category scheme="http://www.binarylogic.com" term="or" /><category scheme="http://www.binarylogic.com" term="scope procedure" />		<summary type="html"><![CDATA[A few days ago I released a feature that Ryan Bates requested: combining named scopes with &#8216;OR&#8217;. As you know, when you combine named scopes they join the conditions with &#8216;AND&#8217;. This obviously makes sense, but what if you want to combine conditions with &#8216;OR&#8217;? With this new feature you can do the following:

User.first_name_or_last_name_like("ben")
User.id_lt_or_age_gt(10)

I think [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/08/26/using-searchlogic-to-combine-named-scopes-with-or/">&lt;p&gt;A few days ago I released &lt;a href="http://github.com/binarylogic/searchlogic/issues/closed#issue/20"&gt;a feature that Ryan Bates requested&lt;/a&gt;: combining named scopes with &amp;#8216;OR&amp;#8217;. As you know, when you combine named scopes they join the conditions with &amp;#8216;AND&amp;#8217;. This obviously makes sense, but what if you want to combine conditions with &amp;#8216;OR&amp;#8217;? With this new feature you can do the following:&lt;/p&gt;
&lt;pre class="ruby"&gt;
User.first_name_or_last_name_like("ben")
User.id_lt_or_age_gt(10)
&lt;/pre&gt;
&lt;p&gt;I think this is nice feature on a variety of levels, but what I particularly like is the implementation.&lt;span id="more-796"&gt;&lt;/span&gt; It uses method_missing to accomplish this. You can call any scope you want, call scopes provided by &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;searchlogic&lt;/a&gt;, call your own scopes, call scopes on associations, etc. As long as it maps to a named scope it will join the conditions with &amp;#8216;OR&amp;#8217;. So you have a little more flexibility when building a query with named scopes:&lt;/p&gt;
&lt;pre class="ruby"&gt;
User.id_gt(10).first_name_or_last_name_like("ben")
# =&gt; (id &gt; 10) AND (first_name LIKE '%ben% OR last_name LIKE '%ben%')
&lt;/pre&gt;
&lt;h2&gt;More than just named scopes&lt;/h2&gt;
&lt;p&gt;A lot of people think &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;searchlogic&lt;/a&gt; is just a bunch of named scopes, what people don&amp;#8217;t realize is that it provides tools around how you use named scopes in general.&lt;/p&gt;
&lt;p&gt;The other day I was reviewing an application for a friend who was using &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;searchlogic&lt;/a&gt;. I noticed this:&lt;/p&gt;
&lt;pre class="ruby"&gt;
User.named_scope :with_recent_orders, :conditions =&gt; ["orders.created_at &gt;= ?", 1.week.ago], :joins =&gt; :orders
Order.named_scope :recent, :conditions =&gt; ["orders.created_at &gt;= ?", 1.week.ago]
&lt;/pre&gt;
&lt;p&gt;See the duplication there? With more complex named scopes this becomes more obvious, but the scope was so simple I think he missed it. I even catch myself doing this sometimes, then I realize I don&amp;#8217;t need to. The named_scope in the User class is pointless. With searchlogic, you can accomplish the same thing by doing:&lt;/p&gt;
&lt;pre class="ruby"&gt;
User.orders_recent
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;searchlogic&lt;/a&gt; dynamically creates the scope for you, pulls over the scope details, and create the necessary join.&lt;/p&gt;
&lt;h2&gt;The goal of named scopes&lt;/h2&gt;
&lt;p&gt;In my opinion the simpler the named scope, the better. If you find yourself writing a complicated named scope, take a step back and look at it. I&amp;#8217;d be willing to bet you could split that named scope into multiple smaller scopes. For example, instead of calling a named scope &amp;#8216;Product.popular_expensive&amp;#8217;, create 2 named scopes called &amp;#8216;popular&amp;#8217; and &amp;#8216;expensive&amp;#8217;. Break your scope into small parts and then piece them together when you need them.&lt;/p&gt;
&lt;p&gt;Another good idea is to create scope procedures. This allows you to create small named scopes and still get the advantage of calling a single scope. Creating a procedure is as easy as creating a class level method:&lt;/p&gt;
&lt;pre class="ruby"&gt;
class User
  def self.awesome
    name_begins_with("Ben").name_ends_with("Johnson")
  end
end
&lt;/pre&gt;
&lt;p&gt;Even better, used searchlogic&amp;#8217;s scope procedure:&lt;/p&gt;
&lt;pre class="ruby"&gt;
User.scope_procedure :awesome, lambda { name_begins_with("Ben").name_ends_with("Johnson") }
&lt;/pre&gt;
&lt;p&gt;I&amp;#8217;ll leave it at that. If you are bored one day checkout the &lt;a href="http://rdoc.info/projects/binarylogic/searchlogic"&gt;searchlogic docs&lt;/a&gt;. I think you&amp;#8217;ll find some small things like this that could help save you time and DRY up your code.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Using%20Searchlogic%20to%20combine%20named%20scopes%20with%20%26%238216%3BOR%26%238217%3B&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F08%2F26%2Fusing-searchlogic-to-combine-named-scopes-with-or%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/J5jx2zYxklY1R-FS_f5KLhc7ebQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J5jx2zYxklY1R-FS_f5KLhc7ebQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/J5jx2zYxklY1R-FS_f5KLhc7ebQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J5jx2zYxklY1R-FS_f5KLhc7ebQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/sMKQa2i_uOE" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/08/26/using-searchlogic-to-combine-named-scopes-with-or/#comments" thr:count="8" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/08/26/using-searchlogic-to-combine-named-scopes-with-or/feed/atom/" thr:count="8" />
		<thr:total>8</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/08/26/using-searchlogic-to-combine-named-scopes-with-or/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Heroku rocked my face off]]></title>
		<link rel="alternate" type="text/html" href="http://feeds.binarylogic.com/~r/binarylogic/~3/KPdMcTM0bmY/" />
		<id>http://www.binarylogic.com/?p=792</id>
		<updated>2009-08-26T07:56:58Z</updated>
		<published>2009-08-25T08:58:52Z</published>
		<category scheme="http://www.binarylogic.com" term="General" /><category scheme="http://www.binarylogic.com" term="Uncategorized" /><category scheme="http://www.binarylogic.com" term="heroku" />		<summary type="html"><![CDATA[This week my task at hand was to figure out a deployment strategy for an application I&#8217;ve been working on. The initial conclusion was that we needed to buy another server. I wasn&#8217;t too happy with this because setting up a new server is a pain in the ass. It&#8217;s very repetitive, mundane, and boring. [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/08/25/heroku-rocked-my-face-off/">&lt;p&gt;This week my task at hand was to figure out a deployment strategy for an application I&amp;#8217;ve been working on. The initial conclusion was that we needed to buy another server. I wasn&amp;#8217;t too happy with this because setting up a new server is a pain in the ass. It&amp;#8217;s very repetitive, mundane, and boring. I&amp;#8217;d much rather be spending time coding or coming up with new ideas instead of maintaining servers.&lt;/p&gt;
&lt;p&gt;That being said, I figured I would see what &lt;a href="http://www.engineyard.com"&gt;engine yard&lt;/a&gt; or &lt;a href="http://www.heroku.com"&gt;heroku&lt;/a&gt; had to offer. Maybe it&amp;#8217;s time my company starts using these services. It would be easier and cheaper.&lt;span id="more-792"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Engine Yard Solo&lt;/h2&gt;
&lt;p&gt;Initially I was interested in engine yard&amp;#8217;s solo plan. It seemed nice. It was a little confusing at first, but only took about an hour of playing around with it to really understand how it works. An hour is a small price to pay for something like this. Their stack was nice, not the stack I would choose, but who the hell cares at this point. I&amp;#8217;m not going to start splitting hairs over using passenger or thin. The only thing I wasn&amp;#8217;t too happy with was the pricing. To run a staging environment on their smallest plan would be around $115 a month. Then a production environment on top of this would be about $300. You&amp;#8217;re looking at $415 a month to run a decent application. Is that a lot of money? Not for an important application, but my company also has a lot of small applications. We have blogs, small intranet apps, etc. That could start to add up, to the point where it would be more expensive than my current set up.&lt;/p&gt;
&lt;h2&gt;Heroku&lt;/h2&gt;
&lt;p&gt;Then I decided to checkout Heroku. The first thing I noticed is that their basic plan is free. You can host an application on there for free to start, which is AWESOME. I love that they do this, and in my opinion this is going to play a big part in their success. I signed up, followed the instructions they gave me, and had an application running in under 5 minutes. It was unbelievable how easy they made it. Literally, you create an application on Heroku, push your code to their git repository, and it deploys the app for you. I sat there for a minute, in awe, trying to soak it all in. It was awesome, but with all of this magic going on there has to be a catch or limitations. So I started to read the docs to try and understand it. To my surprise, there were a lot of advantages to using their set up, specifically around caching. There were also a few limitations, but nothing that I can&amp;#8217;t live without. I won&amp;#8217;t ramble on about the details because a lot of the issues are subjective. For example, is using PostgreSQL a limitation to you? What about a read-only filesystem? I&amp;#8217;ve always been a MySQL guy, but after doing some research on PostgreSQL I really like it, and am going to make it my default choice for future apps.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;If you haven&amp;#8217;t tried out &lt;a href="http://www.heroku.com"&gt;heroku&lt;/a&gt; then you should. It takes about 10 minutes to try out, it&amp;#8217;s free, and it&amp;#8217;s well worth the time. Even if you know it&amp;#8217;s not an option for you, its still fun to play around with. I have a feeling heroku is going to really take off and become a standard for ruby web applications. There are still some loose ends they need to tie up, but once they do there really is no reason not to use their service.&lt;/p&gt;
&lt;p&gt;Also, no, I am not getting paid by Heroku. I wish I was though. I just like to share things on here that make my life easier, and this definitely did.&lt;/p&gt;
&lt;a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Binary%20Logic&amp;amp;siteurl=http%3A%2F%2Fwww.binarylogic.com%2F&amp;amp;linkname=Heroku%20rocked%20my%20face%20off&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F08%2F25%2Fheroku-rocked-my-face-off%2F"&gt;&lt;img src="http://www.binarylogic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P9ltu_hhXO74YcbTq8D70r8m8NQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P9ltu_hhXO74YcbTq8D70r8m8NQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P9ltu_hhXO74YcbTq8D70r8m8NQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P9ltu_hhXO74YcbTq8D70r8m8NQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/binarylogic/~4/KPdMcTM0bmY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/08/25/heroku-rocked-my-face-off/#comments" thr:count="18" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/08/25/heroku-rocked-my-face-off/feed/atom/" thr:count="18" />
		<thr:total>18</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/08/25/heroku-rocked-my-face-off/</feedburner:origLink></entry>
	</feed>
