<?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.feedburner.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>2009-06-15T06:17:15Z</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>
	

			<link rel="self" href="http://feeds.feedburner.com/binarylogic" type="application/atom+xml" /><entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Searchlogic v2 officially released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/nT1RAyAVPL4/" />
		<id>http://www.binarylogic.com/?p=768</id>
		<updated>2009-06-15T06:17:15Z</updated>
		<published>2009-06-15T06:14:47Z</published>
		<category scheme="http://www.binarylogic.com" term="Searchlogic" /><category scheme="http://www.binarylogic.com" term="ruby" /><category scheme="http://www.binarylogic.com" term="search" /><category scheme="http://www.binarylogic.com" term="v2" />		<summary type="html"><![CDATA[Tonight I went ahead and officially released searchlogic v2. If you didn&#8217;t read my last post, v2 is a complete rewrite of the library. It takes a new approach. It went from ~2300 lines of code to ~400 lines of code. It&#8217;s simpler, easier to use, much more light weight, faster, and more importantly, easier [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/06/15/searchlogic-v2-officially-released/">&lt;p&gt;Tonight I went ahead and officially released &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;searchlogic v2&lt;/a&gt;. If you didn&amp;#8217;t read my last post, v2 is a &lt;em&gt;complete&lt;/em&gt; rewrite of the library. It takes a new approach. It went from ~2300 lines of code to ~400 lines of code. It&amp;#8217;s simpler, easier to use, much more light weight, faster, and more importantly, easier to maintain, understand, and improve upon.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not going to ramble about the changes, because you can read my &lt;a hef="http://www.binarylogic.com/2009/06/09/searchlogic-v2-beta-released/"&gt;previous post&lt;/a&gt; or you can check out the &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;read me&lt;/a&gt; on github.&lt;/p&gt;
&lt;h3&gt;Using github not rubyforge&lt;/h3&gt;
&lt;p&gt;I have decided to start using github to host my gems, if you want to start using v2 as a gem you need to install the binarylogic-searchlogic gem from the github source. (checkout the &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;read me&lt;/a&gt; for easy installation instructions).&lt;/p&gt;
&lt;h3&gt;Thank you&lt;/h3&gt;
&lt;p&gt;Sorry for such a quick post. I figured this was an important announcement.&lt;/p&gt;
&lt;p&gt;Thank you for being patient with v1, I know there were some people having issues. This should address all of them.&lt;/p&gt;
&lt;p&gt;As always, I did my best with the &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;readme&lt;/a&gt; and the &lt;a href="http://rdoc.info/projects/binarylogic/searchlogic"&gt;rdocumentation&lt;/a&gt;. If you really want to see what v2 is all about I suggest you take a glance at those, they should be comprehensive.&lt;/p&gt;
&lt;p&gt;I hope you enjoy v2, I&amp;#8217;m really excited to release it. I have already integrated it into the app that I am working on, and I love it. It works great and all of my tests pass.&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=Searchlogic%20v2%20officially%20released&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F06%2F15%2Fsearchlogic-v2-officially-released%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/uwltyTthpbOy-eFNFIYCVW9VURo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uwltyTthpbOy-eFNFIYCVW9VURo/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/uwltyTthpbOy-eFNFIYCVW9VURo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uwltyTthpbOy-eFNFIYCVW9VURo/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/nT1RAyAVPL4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/06/15/searchlogic-v2-officially-released/#comments" thr:count="13" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/06/15/searchlogic-v2-officially-released/feed/atom/" thr:count="13" />
		<thr:total>13</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/06/15/searchlogic-v2-officially-released/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Searchlogic v2 beta released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/XTk-Dua4-sw/" />
		<id>http://www.binarylogic.com/?p=756</id>
		<updated>2009-06-09T04:11:27Z</updated>
		<published>2009-06-09T04:07:14Z</published>
		<category scheme="http://www.binarylogic.com" term="Searchlogic" /><category scheme="http://www.binarylogic.com" term="rails" /><category scheme="http://www.binarylogic.com" term="ruby" /><category scheme="http://www.binarylogic.com" term="search" /><category scheme="http://www.binarylogic.com" term="v2" />		<summary type="html"><![CDATA[Searchlogic v2 beta was released today, it is a complete rewrite of the library, no code was reused. Right now its in a separate branch under the Searchlogic project, and will be merged when it is taken out of beta status. Let me explain how it&#8217;s different.
So, the project I&#8217;m working on now required something [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/06/09/searchlogic-v2-beta-released/">&lt;p&gt;&lt;a href="http://github.com/binarylogic/searchlogic/tree/v2"&gt;Searchlogic v2 beta&lt;/a&gt; was released today, it is a &lt;strong&gt;complete&lt;/strong&gt; rewrite of the library, no code was reused. Right now its in a separate branch under the &lt;a href="http://github.com/binarylogic/searchlogic/tree/master"&gt;Searchlogic project&lt;/a&gt;, and will be merged when it is taken out of beta status. Let me explain how it&amp;#8217;s different.&lt;/p&gt;
&lt;p&gt;So, the project I&amp;#8217;m working on now required something from Searchlogic v1 that it couldn&amp;#8217;t provide. That is, searching with existing named scopes. I could do this, but it wasn&amp;#8217;t as elegant as it was with the built in conditions (Ex: username_like, etc.).&lt;/p&gt;
&lt;h2&gt;The idea behind Searchlogic v2&lt;/h2&gt;
&lt;p&gt;So this got me thinking, how can I get Searchlogic v1 to use existing named scopes? That&amp;#8217;s when it hit me, why not use named scopes for everything?&lt;span id="more-756"&gt;&lt;/span&gt;I think we can all agree named scopes are the heart of searching and breaking up common search logic in your models. Instead of having all of this crazy logic write SQL and chain it together, as in v1, why not have Searchlogic dynamically create these common named scopes for you and then just leverage those? That&amp;#8217;s exactly what v2 does. Instead of going into detail about v2, check out the &lt;a href="http://github.com/binarylogic/searchlogic/tree/v2"&gt;current README&lt;/a&gt;. It explains everything v2 has to offer up to this point.&lt;/p&gt;
&lt;p&gt;The best part about this approach is that it fits nicely into your application. All that it is doing is creating named scopes. More importantly, if you need some condition that Searchlogic doesn&amp;#8217;t offer, no problem, just create your own named scope. This is what you should be doing anyways.&lt;/p&gt;
&lt;p&gt;To bring it all home, let me show a simple search form that uses v2. Assume we have&lt;/p&gt;
&lt;pre&gt;
User(name:string, age:integer)
Order(user_id:integer, total:float)

User.has_many &lt;img src='http://www.binarylogic.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /&gt; rders
User.named_scope :four_year_olds, :conditions =&gt; {:age =&gt; 4}
User.named_scope :name_sounds_like, lamda { |value| {:conditions =&gt; ["name SOUNDS LIKE ?", value]} }
&lt;/pre&gt;
&lt;p&gt;Your search form could look like this:&lt;/p&gt;
&lt;pre class="ruby"&gt;
- form_for @search do |f|
  = f.text_field :name_like
  = f.select :age_greater_than, (1..100)
  = f.text_field &lt;img src='http://www.binarylogic.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /&gt; rders_total_less_than
  = f.text_field :name_sounds_like
  = f.check_box :four_year_olds
  = f.submit
&lt;/pre&gt;
&lt;p&gt;Notice the use of custom named scopes. Also the other conditions are also named scopes that searchlogic dynamically defines as you need them.&lt;/p&gt;
&lt;h2&gt;The best part of v2&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;V1:&lt;/strong&gt; ~2300 lines of code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;V2:&lt;/strong&gt; ~350 lines of code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you might have saw &lt;a href="http://www.binarylogic.com/2009/04/17/need-some-help-searchlogic-20/"&gt;in this post&lt;/a&gt; Searchlogic v1 was too big for me to handle. The issues people were having would take way too long to solve and I just didn&amp;#8217;t like the code. The library really wasn&amp;#8217;t advancing and it was just an annoyance. It was regretably the first library I ever wrote, and as such there are a lot of things I would do differently, which should be evident in v2.&lt;/p&gt;
&lt;p&gt;That being said, v2 is lean, makes sense, and just feels right. I&amp;#8217;m really looking forward to maintaing the library and seeing where it goes. I hope everyone enjoys it. Let me know what you think. There are just a couple of things left to do before I officially release it.&lt;/p&gt;
&lt;h2&gt;Applications using v1&lt;/h2&gt;
&lt;p&gt;Lastly, because this is such a big change, backwards compatibility &lt;em&gt;will&lt;/em&gt; be broken. Before I officially release the library I will write a document explaining the differences and how to transition. In the mean time, your gem declarations in your application should look like this, so that your app doesn&amp;#8217;t break when the new version is released:&lt;/p&gt;
&lt;pre&gt;
 config.gem "searchlogic", :version =&gt; "~&gt; 1.6.6"
# the ~ will let you advance minor and tiny versions, but not major versions.
&lt;/pre&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=Searchlogic%20v2%20beta%20released&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F06%2F09%2Fsearchlogic-v2-beta-released%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/D_ENPELpgC8MDxMj1DhaKhf18PQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D_ENPELpgC8MDxMj1DhaKhf18PQ/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/D_ENPELpgC8MDxMj1DhaKhf18PQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D_ENPELpgC8MDxMj1DhaKhf18PQ/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/XTk-Dua4-sw" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/06/09/searchlogic-v2-beta-released/#comments" thr:count="18" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/06/09/searchlogic-v2-beta-released/feed/atom/" thr:count="18" />
		<thr:total>18</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/06/09/searchlogic-v2-beta-released/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Ruby tips from me, your idol]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/O6ezlyWydy4/" />
		<id>http://www.binarylogic.com/?p=693</id>
		<updated>2009-04-19T19:16:50Z</updated>
		<published>2009-04-19T19:16:50Z</published>
		<category scheme="http://www.binarylogic.com" term="General" /><category scheme="http://www.binarylogic.com" term="Uncategorized" /><category scheme="http://www.binarylogic.com" term="experience" /><category scheme="http://www.binarylogic.com" term="save time" /><category scheme="http://www.binarylogic.com" term="tips" />		<summary type="html"><![CDATA[I feel like I&#8217;ve been in the ruby community for a while now and I&#8217;ve learned a lot along the way. Taking a step back and looking at what I did right and wrong was interesting. Most of the &#8220;wrong&#8221; I had to learn the hard way, and it would have been nice to have [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/04/19/ruby-tips-from-me-your-idol/">&lt;p&gt;I feel like I&amp;#8217;ve been in the ruby community for a while now and I&amp;#8217;ve learned a lot along the way. Taking a step back and looking at what I did right and wrong was interesting. Most of the &amp;#8220;wrong&amp;#8221; I had to learn the hard way, and it would have been nice to have someone tell me: &amp;#8220;Ben, you&amp;#8217;re dumb, stop doing that, and go put on your helmet&amp;#8221;. So I decided to go ahead and throw together a few tips and share them on my blog. Whether you agree or disagree, hopefully this saves you some time, or at least gets you thinking about some things. Afterall, I am your idol, so you are probably going to agree with me.&lt;br /&gt;
&lt;span id="more-693"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;1. Find that perfect balance between being OCD and using your time wisely&lt;/h3&gt;
&lt;p&gt;You can ask anyone I&amp;#8217;ve worked with. I am the king of being OCD with my code. I want everything to be perfect and I don&amp;#8217;t care how hard it is or how much time it takes. This is by far my biggest weakness and has caused me to waste a lot of time. So I decided to come up with a question I ask myself: &lt;em&gt;Will this change benefit me immeadiately?&lt;/em&gt; When I am being OCD the answer is &amp;#8220;no&amp;#8221;, when I am being productive the answer is &amp;#8220;yes&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Perfect example: &lt;a href="http://www.neco.com" target="_blank"&gt;neco.com&lt;/a&gt; was my first rails project. As a result it used a lot of the old rails practices. It wasn&amp;#8217;t RESTful, etc. I really like REST so I decided to go ahead and convert the entire application. I figured if I really grinded it out this would take me a few days. Wrong, it took me about a week and a half, and I was working at least 12 hours a day. Has this benefited me at all? Nope. In fact, our API has some unique requirements and we built an entirely separate application for this. Bottom line, a week and a half wasted. Legacy code is not bad code unless it is restricting you or wasting a lot of your time. neco.com was just fine the way it was. Make the change when you need it, don&amp;#8217;t make the change because you are being OCD.&lt;/p&gt;
&lt;h3&gt;2. Don&amp;#8217;t go against the grain in Rails or invent your own standards&lt;/h3&gt;
&lt;p&gt;I can not tell you how much time I&amp;#8217;ve wasted trying to add in some cool feature into rails. I would dig into the rails internals, override methods, do all kinds of tricky stuff. I thought I was awesome. A month later rails comes out with some cool new feature, I update rails and everything explodes. Yes, maybe this cool new feature of yours would make your code cleaner, leaner, and possibly easier to understand, but it&amp;#8217;s not worth it. You also lose the advantage of having other programmers easily understand your work, because you are not following standards.&lt;/p&gt;
&lt;p&gt;Figure out a way to solve your problem unobtrusively or using the tools rails provides. In the long run, your app will feel much cleaner, it will be easier to understand by other programmers, and you can update rails easily. If you find your self messing around with private methods in rails, 99% of the time that should be a red flag to stop what you are doing.&lt;/p&gt;
&lt;h3&gt;3. Keep your documentation with your code&lt;/h3&gt;
&lt;p&gt;This one is more for library design. It&amp;#8217;s very tempting to use a wiki, post documentation on your blog, etc., because it seems more user friendly for both parties. Believe it or not, a lot of people find &lt;a href="http://rdoc.sourceforge.net/" target="_blank"&gt;rdoc&lt;/a&gt; confusing, and the old rdoc template (before &lt;a href="http://deveiate.org/projects/Darkfish-Rdoc/" target="_blank"&gt;darkfish&lt;/a&gt;) was not fun to use. In my opinion this has changed. Thanks to sites like &lt;a href="http://www.github.com" target="_blank"&gt;Github&lt;/a&gt;, people can now easily fork your project and fix a documentation flaw, which kind of renders a wiki useless for documentation, and rdoc has been updated with a new template format (darkfish) that makes reading documentation MUCH easier. I actually prefer &lt;a href="http://github.com/mislav/hanna/tree/master" target="_blank"&gt;hanna&lt;/a&gt;. It&amp;#8217;s a very nice theme, I used it for the authlogic documentation.&lt;/p&gt;
&lt;p&gt;That being said, you are human, and if the documentation is not with your code you are going to forget to update it from time to time. I made this mistake with my own blog and a lot of my tutorials quickly became out of date. Because of this I&amp;#8217;m sure I wasted a lot of people&amp;#8217;s time trying to figure out what they were doing wrong. When the documentation is next to the code its hard not to update it when you make changes. If you don&amp;#8217;t know how to use rdoc take 5 minutes to learn it. It is better for everyone involved. There is no denying that documentation is a pain in the ass, so the best thing you can do is make it as easy as possible on yourself. If someone doesn&amp;#8217;t want to read through your documentation because they don&amp;#8217;t understand rdoc, oh well. They are programmers and should take the time to learn something that important in ruby.&lt;/p&gt;
&lt;h3&gt;4. Think about what you are reading&lt;/h3&gt;
&lt;p&gt;Just because someone throws something up on their blog doesn&amp;#8217;t mean they are right, my blog included. There are a million ways to solve problems in programming. Many times I have been caught by this. I will read something on a blog from someone that is a very good programmer and just go do it. Later it blows up on me because it actually was not a good tip. Had I of thought about what was going on from a big picture perspective, I could have saved myself a lot of time. Instead I put so much trust into this guy that no matter what he says he must be right.&lt;/p&gt;
&lt;p&gt;If you start doing this, you will instantly become a better programmer. Think about what you are doing, try to understand it, come up with a better solution, etc. This just adds more tools to your nerdy tool belt, which ultimately makes you a better programmer.&lt;/p&gt;
&lt;h3&gt;5. Get involved&lt;/h3&gt;
&lt;p&gt;Unless you are going to work for &lt;a href="http://en.wikipedia.org/wiki/Office_Space" target="_blank"&gt;Initech&lt;/a&gt; where there are a 1000 programmers, no one cares about your resume, what college you went to, your GPA, etc. In my experience, this industry focuses on small elite teams. Part of what&amp;#8217;s great about ruby is the ability to get more done quicker with less resources. This is the trend. That being said, employers are more interested in what you can do vs your qualifications. Even in today&amp;#8217;s crappy economy there are still companies looking for ruby programmers. I recently just got done hiring for my own company. Guess what I looked for more than anything else? Open source involvement and a blog. To me this shows confidence in what you are doing and that you want to show off your abilities. I can openly see how good of a programmer you are, etc. When I got resumes I did not look at what college they went to, what companies they&amp;#8217;ve worked for, I looked for their own website, a github account, etc.&lt;/p&gt;
&lt;p&gt;All that you need to do to set yourself apart from the competition is put up a blog and have some open source involvement. My only regret is that I wish I would have done it sooner. If you haven&amp;#8217;t done anything, at least start with a blog. If you have an interesting post, put the link on rubyflow. That&amp;#8217;s it, you are on the radar. Which leads me to my next point&amp;#8230;&lt;/p&gt;
&lt;h3&gt;6. Avoid mephisto&lt;/h3&gt;
&lt;p&gt;If you&amp;#8217;ve seen my blog before you will notice that it has changed. I recently switched from &lt;a href="http://mephistoblog.com/" target="_blank"&gt;mephisto&lt;/a&gt; to &lt;a href="http://wordpress.org/" target="_blank"&gt;wordpress&lt;/a&gt;. I&amp;#8217;m not going to ramble about this because there is no point. I am just sharing my experience and trying to save people some time and headaches. Maybe I have a little chip on my shoulder because mephisto has wasted a lot of my time, but that&amp;#8217;s the point of this post. I believe new people have taken over the project so it will be interested to see where it goes. The older versions of mephisto were very bad to say the least. I had to set up a number of blogs using them, including my own site. I can not tell you how much of a pain in the ass they are. If you want to customize them, feature wise, you are SOL. Don&amp;#8217;t bother modifying the source because you will not know what the hell is going on. It literally blew my mind that I was looking at a rails app developed by someone on the rails core. So far I have been very impressed with wordpress. Styling it and extending it has been very easy, and there has been a plugin for just about anything I need to do. Also, it takes up a fraction of the resources on my server.&lt;/p&gt;
&lt;h3&gt;7. Stay in the loop, RSS is your friend&lt;/h3&gt;
&lt;p&gt;You should be using RSS, if you are not, you are going to fall behind very quick. Subscribe to important blogs, read the new posts that come in, or at least quickly scan them. Ruby and rails is a very fast paced industry. I feel bad for the people writing books for rails because they quickly become outdated, some become outdated before they even have a chance to get published. That being said, you should spend at least 10 minutes every morning reading through RSS posts. That 10 minutes could introduce you to a new feature that could save you hours. If you don&amp;#8217;t know where to start, start by subscriing to &lt;a href="http://railsenvy.com/" target="_blank"&gt;Rails Envy&lt;/a&gt;. They basically gather all of the important things that happen on a weekly basis and fill you in. If you commute to work, download their podcast and listen to it on the way to work. If you are trying to become a better ruby programmer, there is no reason why you should not do this.&lt;/p&gt;
&lt;h3&gt;8. Have balance in your life&lt;/h3&gt;
&lt;p&gt;Take some time for yourself to get outside and away from computers. I find that I am much more productive when I have a good balance in my life. I enjoy work more, my work is better, I am more creative, etc. I&amp;#8217;ve been on both sides of the fence and I would venture to say that I probably would have been more productive during those 80 hour work weeks if I had taken some time away from the computer. If programming is your livelihood you should give this some serious thought. The last thing you want to do is establish a career in something that you no longer enjoy because you burned yourself out.&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=Ruby%20tips%20from%20me%2C%20your%20idol&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F04%2F19%2Fruby-tips-from-me-your-idol%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/HT879h-hlS7b1t8GK1GTTIkuWvk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HT879h-hlS7b1t8GK1GTTIkuWvk/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/HT879h-hlS7b1t8GK1GTTIkuWvk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HT879h-hlS7b1t8GK1GTTIkuWvk/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/O6ezlyWydy4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/04/19/ruby-tips-from-me-your-idol/#comments" thr:count="22" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/04/19/ruby-tips-from-me-your-idol/feed/atom/" thr:count="22" />
		<thr:total>22</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/04/19/ruby-tips-from-me-your-idol/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Need some help: Searchlogic 2.0]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/nViysuZ12ts/" />
		<id>http://www.binarylogic.com/?p=685</id>
		<updated>2009-04-17T20:09:54Z</updated>
		<published>2009-04-17T20:09:54Z</published>
		<category scheme="http://www.binarylogic.com" term="Searchlogic" />		<summary type="html"><![CDATA[Searchlogic was the first gem I built. I learned A LOT along the way and I continued to learn after releasing it. As such, there are some things I would do differently now. I would say the #1 lesson I learned is don&#8217;t release a complicated gem as your first gem. For example, my first [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/04/17/need-some-help-searchlogic-20/">&lt;p&gt;&lt;a href="http://github.com/binarylogic/searchlogic/tree/master" target="_blank"&gt;Searchlogic&lt;/a&gt; was the first gem I built. I learned A LOT along the way and I continued to learn after releasing it. As such, there are some things I would do differently now. I would say the #1 lesson I learned is don&amp;#8217;t release a complicated gem as your first gem. For example, my first gem should have been &lt;a href="http://github.com/binarylogic/settingslogic/tree/master"&gt;Settingslogic&lt;/a&gt;. What makes Searchlogic complicated is NOT idea behind it, its the integration with ActiveRecord, and the influence ActiveRecord had on the library design. I&amp;#8217;m not sure if you&amp;#8217;ve ever peaked in the ActiveRecord internals, but it&amp;#8217;s by far one of the most complicated libraries I&amp;#8217;ve ever had to deal with. I feel like I know my way around ruby pretty well, and there are still some things in ActiveRecord that kick my ass. I&amp;#8217;m sure ActiveRecord is in the same boat as Searchlogic, if DHH or the rails team had to start from scratch, I&amp;#8217;m sure there are some things they would do differently. Writing an ORM library is no easy task, and ActiveRecord is an excellent solution. Probably much better than anything I could do myself.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-685"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;That being said, just like any library, there are new bugs and problems people find when they use them in unique situations. This is fine and expected, the problem is that solving these problems and writing tests for them takes a lot more time than it should because it is complicated. Between my other open source projects and my job I simply do not have time to keep up with all of them. So I have 2 choices:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Stop supporting the library and let someone else take it over&lt;/li&gt;
&lt;li&gt;Rewrite the library so it is easily maintainable&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I am choosing #2. For 2 reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I have some very important projects using this library, as I&amp;#8217;m sure you do. So I am personally invested into this library.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/binarylogic/authlogic/tree/master" target="_blank"&gt;Authlogic&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Why Authlogic? Because I feel VERY good about the design behind Authlogic. Not to sound conceited, but the design behind it is really clean. It&amp;#8217;s extremely easy to maintain and understand. As such, I don&amp;#8217;t have to spend that much time on it. Most of the time I spend on it is adding new features that people need, not fixing bugs. Which is a lot of fun. I rarely get problems reported with Authlogic. So instead of writing tests and fixing bugs I am advancing the library. I want to have the same feeling with searchlogic, and I&amp;#8217;m just not right now.&lt;/p&gt;
&lt;h2&gt;A call for help&lt;/h2&gt;
&lt;p&gt;That being said, I&lt;strong&gt; want to see if anyone wants to help out&lt;/strong&gt;. I have some really good ideas about how to do this and keep it clean and simple. Because of this, I think it could be done in a relatively short amount of time. More importantly, it could be a fun project and a good experience for both of us.&lt;/p&gt;
&lt;h2&gt;The idea behind Searchlogic 2.0&lt;/h2&gt;
&lt;p&gt;If you are interested, here is the big change that I want to make. I initially want to write the library as a stand alone class, with no ORM integration. I just want to build a simple library the people can use to create search objects, etc. Then you could take this object and boil it down to whatever format you want, including ActiveRecord find options. So essentially you would have an ActiveRecord adapter. This is the key to keeping the library simple, it doesn&amp;#8217;t have to rely on ActiveRecord and it&amp;#8217;s not influenced by some of the poor design decisions behind it. For example:&lt;/p&gt;
&lt;pre&gt;search = Searchlogic.new
search.where.name_like = "sweet deal"
search.page = 2
search.per_page = 10

search.to_ar_find_options
# =&amp;gt;  {:conditions =&amp;gt; ["name like ?", "%sweet deal%"], &lt;img src='http://www.binarylogic.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /&gt; ffset =&amp;gt; 10, :limit =&amp;gt; 10}
search.where.to_ar_conditions
# =&amp;gt; ["name like ?", "%sweet deal%"]

search.to_sql
# =&amp;gt; "where name like '%sweet deal%' limit 10 offset 10"

search.to_dm_find_options
# DataMapper find options&lt;/pre&gt;
&lt;p&gt;See where I&amp;#8217;m going with this? It&amp;#8217;s strictly influenced by what we think is useful when searching data. It&amp;#8217;s not influenced by SQL, ActiveRecord, or anything. It&amp;#8217;s completely stand alone. I think this is a MUCH cleaner approach. It completely separates Searchlogic from ActiveRecord, so its a stand alone library. I don&amp;#8217;t have to worry about &amp;#8220;ActiveRecord changed this&amp;#8230;&amp;#8221;, or &amp;#8220;ActiveRecord added this&amp;#8230;&amp;#8221;, etc.&lt;/p&gt;
&lt;p&gt;I want to keep searchlogic clean and simple with no dependencies. I think this project would be a lot of fun, but the fact is that I do not have time to sit down and write a new library like this and still fulfill my responsibilities at my job. Gotsta pay them bills.&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=Need%20some%20help%3A%20Searchlogic%202.0&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F04%2F17%2Fneed-some-help-searchlogic-20%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/gIzVq_jmnKUUnP0Zg-JRHnURths/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gIzVq_jmnKUUnP0Zg-JRHnURths/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/gIzVq_jmnKUUnP0Zg-JRHnURths/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gIzVq_jmnKUUnP0Zg-JRHnURths/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/nViysuZ12ts" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/04/17/need-some-help-searchlogic-20/#comments" thr:count="7" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/04/17/need-some-help-searchlogic-20/feed/atom/" thr:count="7" />
		<thr:total>7</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/04/17/need-some-help-searchlogic-20/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Authlogic generators? All of the cool kids are doing it.]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/3_58UUmcCDA/" />
		<id>http://www.binarylogic.com/?p=677</id>
		<updated>2009-04-17T07:30:03Z</updated>
		<published>2009-04-17T07:29:46Z</published>
		<category scheme="http://www.binarylogic.com" term="Authlogic" /><category scheme="http://www.binarylogic.com" term="base app" /><category scheme="http://www.binarylogic.com" term="generators" /><category scheme="http://www.binarylogic.com" term="rails templates" />		<summary type="html"><![CDATA[Lately I&#8217;ve been getting a lot of pressure to add a generator to Authlogic. One of the big things I &#8220;tout&#8221; about Authlogic is the fact that is does not need generators, not anymore than any other RESTful controller you create. Authlogic can pull this off because it&#8217;s intuitive, it works just like every other [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/04/17/authlogic-generators-all-of-the-cool-kids-are-doing-it/">&lt;p&gt;&lt;img class="size-full wp-image-679 alignleft" title="peer_pressure" src="http://www.binarylogic.com/wp-content/uploads/2009/04/peer_pressure.jpg" alt="peer_pressure" width="150" height="107" /&gt;Lately I&amp;#8217;ve been getting a lot of pressure to add a generator to Authlogic. One of the big things I &amp;#8220;tout&amp;#8221; about Authlogic is the fact that is does not need generators, not anymore than any other RESTful controller you create. Authlogic can pull this off because it&amp;#8217;s intuitive, it works just like every other model you have in your application. Unless you want to customize how it works, there&amp;#8217;s no learning curve. If you know how to set up a RESTful controller for an ORM model, then you know how to set up a RESTful controller for an Authlogic model.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-677"&gt;&lt;/span&gt;In my opinion generators are meant to be a starting point for repetitive tasks that have no sustainable pattern. By repetitive, I mean repetitive in a single application. Ex: multiple controllers, multiple models, etc. 95% of applications are going to create 1 Authlogic model and 1 controller for that model. If they are creating more than one, it is mostly likely for a highly unique situation where a generator would be of no use. Which leads me to my question:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why not just create your own personalized base application or template that you can start from when you need to start a new application?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is exactly why rails templates were created. They were created for this exact problem. A generator is never going to please everyone, and if it does, it would have a million options and be extremely complicated. Also, I don&amp;#8217;t know about you, but I am extremely picky about my code. Even if my code and someone else&amp;#8217;s code does the exact same thing, I want my code formatted a certain way. This is a big reason why I dislike restful_authentication. All of this code, that I do not like, gets inserted into my application. It just feels dirty. I&amp;#8217;d much rather build my own authentication solution into a base app, that I like, and use that in my next application.&lt;/p&gt;
&lt;p&gt;I just haven&amp;#8217;t been convinced that creating a generator for Authlogic is a good use of my time. If you can convince me otherwise I&amp;#8217;ll gladly do it. It&amp;#8217;s not that I don&amp;#8217;t want to spend the time, its that I truly feel a base app or a rails template is a better solution.&lt;/p&gt;
&lt;p&gt;What do you think?&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%20generators%3F%20All%20of%20the%20cool%20kids%20are%20doing%20it.&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F04%2F17%2Fauthlogic-generators-all-of-the-cool-kids-are-doing-it%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/sSKnOq7t6vZa3J8MUpxZRv9JFH4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sSKnOq7t6vZa3J8MUpxZRv9JFH4/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/sSKnOq7t6vZa3J8MUpxZRv9JFH4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sSKnOq7t6vZa3J8MUpxZRv9JFH4/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/3_58UUmcCDA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/04/17/authlogic-generators-all-of-the-cool-kids-are-doing-it/#comments" thr:count="8" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/04/17/authlogic-generators-all-of-the-cool-kids-are-doing-it/feed/atom/" thr:count="8" />
		<thr:total>8</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/04/17/authlogic-generators-all-of-the-cool-kids-are-doing-it/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Resourcelogic, what do you think?]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/gOXE8Cq_VHM/" />
		<id>0/2009/04/03/resourcelogic-what-do-you-think</id>
		<updated>2009-04-02T22:32:00Z</updated>
		<published>2009-04-02T22:32:00Z</published>
		<category scheme="http://www.binarylogic.com" term="Resourcelogic" /><category scheme="http://www.binarylogic.com" term="resources" />		<summary type="html"><![CDATA[I recently released the beta to a library I have been working on: Resourcelogic.
I&#8217;m really excited to release this because it&#8217;s my favorite &#8220;personal&#8221; library. I&#8217;ve been waiting to release it because I wanted to give it a thorough test drive on an app I am developing. I can say, without a doubt, that because [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/04/02/resourcelogic-what-do-you-think/">&lt;p&gt;I recently released the beta to a library I have been working on: &lt;a href="http://github.com/binarylogic/resourcelogic/tree/master"&gt;Resourcelogic&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m really excited to release this because it&amp;#8217;s my favorite &amp;#8220;personal&amp;#8221; library. I&amp;#8217;ve been waiting to release it because I wanted to give it a thorough test drive on an app I am developing. I can say, without a doubt, that because of this library, the app is the cleanest app I&amp;#8217;ve written to date. I love it.&lt;/p&gt;
&lt;p&gt;The reason I am writing this post is because I want to see what you think. Before I officially announce it, clean up the documentation, add in my tests, and take it out of beta, I wanted to get some feedback on it. So if you have a minute, take a look at it and let me know what you think.&lt;/p&gt;
&lt;p&gt;Oh, and I&amp;#8217;d like to give a lot of credit to James Golick. This project spawned out of his &lt;a href="http://github.com/giraffesoft/resource_controller/tree/master"&gt;resource_controller plugin&lt;/a&gt;, which is an excellent plugin.&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=Resourcelogic%2C%20what%20do%20you%20think%3F&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F04%2F02%2Fresourcelogic-what-do-you-think%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/wEAjA4d0E2e9uqxdJ3zY_T6Vvck/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wEAjA4d0E2e9uqxdJ3zY_T6Vvck/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/wEAjA4d0E2e9uqxdJ3zY_T6Vvck/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wEAjA4d0E2e9uqxdJ3zY_T6Vvck/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/gOXE8Cq_VHM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/04/02/resourcelogic-what-do-you-think/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/04/02/resourcelogic-what-do-you-think/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/04/02/resourcelogic-what-do-you-think/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Authlogic 2.0 with some OpenID goodness]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/eHS1_KBpDB4/" />
		<id>0/2009/03/30/authlogic-2-0-with-some-openid-goodness</id>
		<updated>2009-04-18T00:09:27Z</updated>
		<published>2009-03-30T05:12:00Z</published>
		<category scheme="http://www.binarylogic.com" term="Authlogic" /><category scheme="http://www.binarylogic.com" term="openid" />		<summary type="html"><![CDATA[
This post is somewhat of a 2 part announcement:

The release of Authlogic 2.0
The release of Authlogic OpenId 1.0 with a live example

I apologize for this post being a little delayed, this week was unusually busy for me and I wanted to wait until I had time to write an article giving these 2 things their [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/03/30/authlogic-2-0-with-some-openid-goodness/">&lt;p&gt;&lt;img class="size-full wp-image-582 alignleft" title="mousepad" src="http://new.binarylogic.com/wp-content/uploads/2009/04/mousepad.jpg" alt="Signing mouse pads" width="200" height="156" /&gt;&lt;/p&gt;
&lt;p&gt;This post is somewhat of a 2 part announcement:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The release of &lt;a href="http://github.com/binarylogic/authlogic"&gt;Authlogic 2.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The release of &lt;a href="http://github.com/binarylogic/authlogic_openid"&gt;Authlogic OpenId 1.0&lt;/a&gt; with a &lt;a href="http://authlogicexample.binarylogic.com"&gt;live example&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I apologize for this post being a little delayed, this week was unusually busy for me and I wanted to wait until I had time to write an article giving these 2 things their due diligence. So let&amp;#8217;s get right to it.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-543"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Authlogic 2.0&lt;/h2&gt;
&lt;p&gt;I won&amp;#8217;t bore you with &lt;em&gt;ALL&lt;/em&gt; of the changes I made to v2.0, almost all of them are internal and a result of me being OCD, so I&amp;#8217;ll try to fill you in quickly. The only change you might have to make when migrating is how acts_as_authentic accepts configuration. Instead of accept a hash, it now accepts a block. Ex:&lt;/p&gt;
&lt;pre class="ruby"&gt;acts_as_authentic do |c|
  c.my_value = my_option
end&lt;/pre&gt;
&lt;p&gt;If you want a more detailed list of changes you can check out the &lt;a href="http://github.com/binarylogic/authlogic/commits/master"&gt;github commit history&lt;/a&gt; or the &lt;a href="http://github.com/binarylogic/authlogic/blob/6b2532ace33e5edc165a3c466feba5c32156366c/CHANGELOG.rdoc"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That being said, I basically rewrote the entire library. I literally created a new folder for Authlogic 2.0 and went from there; pulled over any reusable code, etc. Why would I do this? Because the focus of v2.0 was around the public API. So much that I rewrote the library to use its own API. If you are curious, take a look at the &lt;a href="http://github.com/binarylogic/authlogic/tree/6b2532ace33e5edc165a3c466feba5c32156366c/lib/authlogic/session"&gt;Authlogic::Session&lt;/a&gt; and &lt;a href="http://github.com/binarylogic/authlogic/tree/6b2532ace33e5edc165a3c466feba5c32156366c/lib/authlogic/acts_as_authentic"&gt;Authlogic::ActsAsAuthentic&lt;/a&gt; submodules. Any of those files could be easily pulled out into their library and be plugged into Authlogic. So if you are wanting some examples of how to extend Authlogic just glance at those sub modules. If you are super geek, I would love to hear your thoughts on the internal design of Authlogic. I feel very good about it and if you can punch some holes in the design I would be pretty impressed, more importantly I think its a good opportunity for both of us to learn something.&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;OpenID so easy you might think its from New Jersey&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Now here is why Authlogic 2.0 is great. Because of 2.0 I was able to write a really nice OpenID &amp;#8220;add on&amp;#8221; for Authlogic. &lt;a href="http://github.com/binarylogic/authlogic_openid"&gt;Check it out on github&lt;/a&gt; or &lt;a href="http://authlogicexample.binarylogic.com"&gt;see the live example&lt;/a&gt;. I&amp;#8217;m not going to go into the set up and installation, because its all in the docs. Instead I&amp;#8217;ll tell you the basic design behind it and how it works.&lt;/p&gt;
&lt;p&gt;To &lt;em&gt;really&lt;/em&gt; authenticate with OpenID you need to do 2 things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify their OpenID when the user registering or updating their profile.&lt;/li&gt;
&lt;li&gt;Verify their OpenID when they are logging in.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As you probably saw in my older OpenID tutorial, one of the downfalls what that it didn&amp;#8217;t accomplish #1. It just authenticated when the user tried to log in. With Authlogic 2.0 this is no longer the case. I feel like it&amp;#8217;s a very solid OpenID solution.&lt;/p&gt;
&lt;p&gt;The best part is that its dead simple, it really doesn&amp;#8217;t get any easier than this. Just to prove my point, here is the basic setup process:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add a field to your database to store the user&amp;#8217;s openid_identifier&lt;/li&gt;
&lt;li&gt;Install the authlogic-oid gem&lt;/li&gt;
&lt;li&gt;Install and setup the &lt;a href="http://github.com/rails/open_id_authentication/tree/master"&gt;openid_authentication&lt;/a&gt; plugin by the rails team.&lt;/li&gt;
&lt;li&gt;Save your Authlogic::Session::Base and ActiveRecord::Base objects with a block whenever you want to verify their OpenID.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So instead of this:&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;if @user_session.save
  redirect_back_or_default account_url
else
  render :action =&amp;gt; :new
end&lt;/pre&gt;
&lt;p&gt;Do this:&lt;/p&gt;
&lt;pre class="ruby"&gt;@user_session.save do |result|
  if result
    redirect_back_or_default account_url
  else
    render :action =&amp;gt; :new
  end
end&lt;/pre&gt;
&lt;p&gt;Why? Because the AuthlogicOpenid add on takes care of redirecting the user to their OpenID provider. When it redirects it needs to skip that entire block of code to avoid a DoubleRender error.&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;The Authlogic challenge&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Now there there is an established and well defined public API I encourage you to write your own add ons. There are 3 that I am going to need in the near future, and I feel would be extremely beneficial to other authlogic users:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;AuthlogicImap&lt;/strong&gt; &amp;#8211; authentication via IMAP. Meaning users could provide an email address and password and Authlogic would try to authenticate with their IMAP server. This is a GREAT solution for intranet authentication. In fact, I plan to implement this in my company as soon as I can. This way they will have one password for everything: email, intranet apps, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AuthlogicFacebook&lt;/strong&gt; &amp;#8211; I don&amp;#8217;t think this requires a lot of explanation, but the goal of this would be to authenticate with Facebook&amp;#8217;s authentication solution: Facebook Connect. I really think if a single sign on solution becomes popular, this is the one, because of the sheer volume of users on Facebook it&amp;#8217;s impossible to ignore.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AuthlogicLdap&lt;/strong&gt; &amp;#8211; Allow users to authenticate via LDAP.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So if you are wanting to write an add on for Authlogic, I encourage you to do one of the above, because I feel those would be the most widely used. But if you want to write something else, go for it.&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;What do you get?&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;To get this moving along, I am offering incentives. I know it kind of goes against the basic principles of open source, but what the hell, I figured I would try to spice it up a little bit.&lt;/p&gt;
&lt;p&gt;If you write an Authlogic add-on that is approved by me I will personally sign a mouse pad and send it right to your house, or work if you want to show it off to your colleagues. Even better, have it &amp;#8220;accidentally&amp;#8221; sent to your girlfriend&amp;#8217;s house and guarantee yourself some action that night.&lt;/p&gt;
&lt;p&gt;Alright, enough of that, here is what you really get:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Officially announce it on my blog and link to it wherever relevant (Authlogic docs, wiki, etc.).&lt;/li&gt;
&lt;li&gt;Authlogic commit rights, if you want them.&lt;/li&gt;
&lt;li&gt;Employee discount at &lt;a href="http://www.neco.com"&gt;neco.com&lt;/a&gt; (one of my companies).&lt;/li&gt;
&lt;li&gt;$25 itunes gift card. (only if you write one of the above 3)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I know #3 is kind of lame, but hey, if you like going to events I can get you tickets to just about anything at a steal.&lt;/p&gt;
&lt;p&gt;So that&amp;#8217;s my speech, let me know what you think.&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%202.0%20with%20some%20OpenID%20goodness&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F03%2F30%2Fauthlogic-2-0-with-some-openid-goodness%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/w-bNO1O4RZhRv_96Xj31dmaPyes/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w-bNO1O4RZhRv_96Xj31dmaPyes/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/w-bNO1O4RZhRv_96Xj31dmaPyes/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w-bNO1O4RZhRv_96Xj31dmaPyes/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/eHS1_KBpDB4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/03/30/authlogic-2-0-with-some-openid-goodness/#comments" thr:count="22" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/03/30/authlogic-2-0-with-some-openid-goodness/feed/atom/" thr:count="22" />
		<thr:total>22</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/03/30/authlogic-2-0-with-some-openid-goodness/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[The future of Authlogic: add ons]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/C4_u8Lqbq4w/" />
		<id>0/2009/03/23/the-future-of-authlogic-add-ons</id>
		<updated>2009-04-17T18:41:37Z</updated>
		<published>2009-02-25T09:43:00Z</published>
		<category scheme="http://www.binarylogic.com" term="Authlogic" /><category scheme="http://www.binarylogic.com" term="Addons" />		<summary type="html"><![CDATA[
It&#8217;s funny to say this, because Authlogic has only been out for about 4 months, but I feel like it&#8217;s a pretty solid, lean, and mature library. I feel this way because of the community around Authlogic. At lot of people have contributed bug fixes, feature additions, performance enhancements, etc. It&#8217;s been a really fun [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2009/02/25/the-future-of-authlogic-add-ons/">&lt;p&gt;&lt;img class="size-full wp-image-594 alignleft" title="Mr. Anti Bloat" src="http://new.binarylogic.com/wp-content/uploads/2009/04/bloat3.jpg" alt="Mr. Anti Bloat" width="225" height="286" /&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s funny to say this, because Authlogic has only been out for about 4 months, but I feel like it&amp;#8217;s a pretty solid, lean, and mature library. I feel this way because of the community around Authlogic. At lot of people have contributed bug fixes, feature additions, performance enhancements, etc. It&amp;#8217;s been a really fun experience and shown me first hand how great open source can be on the other side of the fence.&lt;/p&gt;
&lt;p&gt;That being said, feature-wise, it&amp;#8217;s starting to plateau. At this stage it is tempting to start adding extraneous features that bloat the library. Obviously, no one likes a big bloated, complicated library, so I&amp;#8217;ve been pretty picky with the features added. There is a very fine line that separates features that belong in an optional module and features that belong in the core that are toggled via a configuration option. Instead of slowing the growth of Authlogic by being Mr. anti-bloat, it would make more sense to provide a venue for extension, otherwise called a public API. I know that&amp;#8217;s a pretty fundamental idea, but that&amp;#8217;s what this post is all about. The last few releases of Authlogic have focused hard on the public API. Authlogic uses it&amp;#8217;s own API internally and I have also used it in a few projects of mine. It has worked out great. So far, I have not encountered any limitations and I am confident it&amp;#8217;s ready for prime time.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-436"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Getting the ball rolling&lt;/h2&gt;
&lt;p&gt;So I thought I would get the ball rolling with a few &amp;#8220;add on&amp;#8221; gems for authlogic. Here is the list I have so far, in the order of priority. I wanted to reach out to you and see if you have any suggestions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;li&gt;&lt;strong&gt;authlogic_openid (code is already written)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;authlogic_ldap (code is already written)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;authlogic_facebook_connect&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;authlogic_captcha&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;authlogic_authorization (still somewhat on the fence with this)&lt;/strong&gt;&lt;/li&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/ol&gt;
&lt;p&gt;What do you think? Am I missing anything obvious? Do you have any other &amp;#8220;add on&amp;#8221; gems you&amp;#8217;d like to see added?&lt;/p&gt;
&lt;p&gt;I plan to release the first gem in the next couple of weeks.&lt;/p&gt;
&lt;p&gt;P.S. &amp;#8211; the picture contains an oxymoron, it&amp;#8217;s a tough one to figure out&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=The%20future%20of%20Authlogic%3A%20add%20ons&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2009%2F02%2F25%2Fthe-future-of-authlogic-add-ons%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/7bDvle9k4QoeVDFA6GSLx0kj1VI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7bDvle9k4QoeVDFA6GSLx0kj1VI/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/7bDvle9k4QoeVDFA6GSLx0kj1VI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7bDvle9k4QoeVDFA6GSLx0kj1VI/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/C4_u8Lqbq4w" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2009/02/25/the-future-of-authlogic-add-ons/#comments" thr:count="33" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2009/02/25/the-future-of-authlogic-add-ons/feed/atom/" thr:count="33" />
		<thr:total>33</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2009/02/25/the-future-of-authlogic-add-ons/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Searchlogic 1.5.7 &#8211; Complex searching no longer a problem]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/Fa_-nAmmxgY/" />
		<id>0/2009/03/23/searchlogic-1-5-7-complex-searching-no-longer-a-problem</id>
		<updated>2009-04-17T03:34:38Z</updated>
		<published>2008-11-30T07:59:00Z</published>
		<category scheme="http://www.binarylogic.com" term="Searchlogic" /><category scheme="http://www.binarylogic.com" term="advanced searching" /><category scheme="http://www.binarylogic.com" term="complex searching" />		<summary type="html"><![CDATA[Searchlogic 1.5.7 is by far my favorite release because it takes Searchlogic to a whole new level. It solves a problem I thought it would never solve. Before I explain the new features, let me give you a quick run down on my perspective of Searchlogic:

Fillin&#8217; a brotha in
A lot of people think Searchlogic is [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2008/11/30/searchlogic-1-5-7-complex-searching-no-longer-a-problem/">&lt;p&gt;Searchlogic 1.5.7 is by far my favorite release because it takes Searchlogic to a whole new level. It solves a problem I thought it would never solve. Before I explain the new features, let me give you a quick run down on my perspective of Searchlogic:&lt;/p&gt;
&lt;p&gt;&lt;span id="more-280"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Fillin&amp;#8217; a brotha in&lt;/h2&gt;
&lt;p&gt;A lot of people think Searchlogic is a &amp;#8220;console&amp;#8221; searching utility. Meaning you can pop into your console and execute some simple searches quickly and easily, and it is, but by accident. My goal with Searchlogic has always been freeing your application of searching clutter. If you&amp;#8217;ve ever done an app with searching you know there is a lot of &amp;#8220;cruft&amp;#8221; that goes along with it: nasty controller actions, excessive named_scopes, etc. Searchlogic rids you of this by representing an entire search&amp;#8217;s criteria with a hash: conditions, ordering, pagination, the whole package. Why is this nice? Because GET and POST parameters are a hash. What&amp;#8217;s nice about that? Because an HTML form&amp;#8217;s sole purpose is to send GET and POST parameters to a URI. This means you can build a form that represents your entire search. Adding a condition to your search is as easy as adding a field to your form. This ultimately makes your controller dead simple, frees it of any search clutter, and rids your models of excessive named_scopes. Here is what your controller action should look like with Searchlogic:&lt;/p&gt;
&lt;pre class="ruby"&gt;@search = User.new_search(params[:search])
@users = @search.all&lt;/pre&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;h2&gt;Complex searching in tha house&lt;/h2&gt;
&lt;p&gt;This is great for simple searching, but how do you represent complex searches this way? Let&amp;#8217;s take this query:&lt;/p&gt;
&lt;pre class="ruby"&gt;select * from users where id &amp;gt; 5 AND
  (email LIKE 'ben%' or email LIKE '%binarylogic.com') AND
  first_name LIKE '%ben%'&lt;/pre&gt;
&lt;p&gt;Before, Searchlogic couldn&amp;#8217;t handle this. It did not support grouping (parenthesis) and it did not allow you to mix and match &amp;#8220;AND&amp;#8221; and &amp;#8220;OR&amp;#8221;, you had to pick one or the other. Why? Because I never intended for Searchlogic to replace complex searching. If you need to perform a complex search there is nothing wrong with using Searchlogic in conjunction with some named_scopes. SQL is not bad, but what is bad is that all of that searching cruft starts seeping back into your project. All of a sudden your controller is not clean, your form has to stray away from using the form builder, and your model gets cluttered with named scopes that you are only using for one section in your application. Searchlogic fails to meet its goal of keeping your application free of &amp;#8220;search clutter&amp;#8221; and a tear runs down your cheek.&lt;/p&gt;
&lt;h2&gt;Slap a prefix on it!&lt;/h2&gt;
&lt;p&gt;Solving the problem of mixing &amp;#8220;AND&amp;#8221; and &amp;#8220;OR&amp;#8221; was easier than I thought. The only major change I had to make was making the conditions order relevant. The order you set your conditions is the same order they will appear in your SQL statement. Before, the conditions were stored in a hash, where order was not preserved. Now you can slap an &amp;#8220;and_&amp;#8221; or &amp;#8220;or_&amp;#8221; prefix in front of your conditions:&lt;/p&gt;
&lt;pre class="ruby"&gt;search = User.new_search
search.conditions.name_like = "Ben"
search.conditions.or_email_like = "a@a.com"
search.conditions.and_id_gt = 5
# =&amp;gt; name LIKE '%Ben%' OR email like '%a@a.com%' AND id &amp;gt; 5&lt;/pre&gt;
&lt;p&gt;The last condition &amp;#8220;and_id_gt&amp;#8221; could also be written as &amp;#8220;id_gt&amp;#8221;, because, by default, we are joining with &amp;#8220;AND&amp;#8221;. Not specifying a prefix uses whatever you are joining your conditions with by default, specifying a prefix will &lt;em&gt;always&lt;/em&gt; use that join. If you want your conditions to be joined by &amp;#8220;OR&amp;#8221; by default just do:&lt;/p&gt;
&lt;pre class="ruby"&gt;search.any = true&lt;/pre&gt;
&lt;h2&gt;You best wrap it with some parenthesis&lt;/h2&gt;
&lt;p&gt;What about grouping conditions with parenthesis? No problem. Take the above query:&lt;/p&gt;
&lt;pre class="ruby"&gt;search = User.new_search
search.conditions.id_gt = 5
search.conditions.group do |group|
  group.email_begins_with = "ben"
  group.or_email_ends_with = "binarylogic.com"
end
search.conditions.first_name_contains = "ben"
search.all&lt;/pre&gt;
&lt;p&gt;What about a hash?&lt;/p&gt;
&lt;pre class="ruby"&gt;search = User.new_search(:conditions =&amp;gt; [
  {:id_gt =&amp;gt; 5},
  {:group =&amp;gt; [
    {:email_begins_with =&amp;gt; "ben"},
    {:or_email_ends_with =&amp;gt; "binarylogic.com"}
  ]},
  {:first_name_contains =&amp;gt; "ben"}
])&lt;/pre&gt;
&lt;p&gt;What about a form?&lt;/p&gt;
&lt;pre class="ruby"&gt;- form_for @search do |search|
  - search.fields_for "conditions" do |conditions_array|
    - conditions_array.fields_for "[]", search.object.conditions do |conditions|
      = conditions.text_field :id_gt
      - conditions.fields_for "group" do |group_array|
        - group_array.fields_for "[]" do |group|
          = group.text_field :email_begins_with
          = group.text_field &lt;img src='http://www.binarylogic.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /&gt; r_email_ends_with
      = conditions.text_field :first_name_contains&lt;/pre&gt;
&lt;p&gt;You will notice the hash and the form are implementing arrays, thats because hashes do not preserve the order. In our case above, order is important to us. What does preserve the order? An array. So if order is relevant to you, then you need to structure your conditions into an array. There is no other choice with this, because forms can either submit a hash or an array of parameters.&lt;/p&gt;
&lt;p&gt;I know what you are thinking: &amp;#8220;the above looks a little confusing and messy&amp;#8221;. I agree with you, to a point. The word &amp;#8220;messy&amp;#8221; is a relative term. In our case, we have no other choice, this is the 100% correct way to do this. That being said, this is clean, because there is no other cleaner option. Sorry to be a debbie downer here, but this is how forms work, there is nothing I can do about that. Regardless, the above is still cleaner than having a nasty controller action or adding a bunch of named_scopes into you model. Your search logic is nice and DRY, in one spot: the view.&lt;/p&gt;
&lt;h2&gt;99 problems, but complex searching aint one&lt;/h2&gt;
&lt;p&gt;I think this is pretty nifty, now you have the tools to construct any type of search in your form. I&amp;#8217;ve been getting a lot of emails asking me about this, and I had to be a debbie downer and tell them to use named scopes. Now you can ditch the named scopes and keep your search logic nice and DRY in your form, where it probably belongs.&lt;/p&gt;
&lt;p&gt;The last thing I want to say is that there is a time and a place for a named scope, by no means am I discouraging them, because they are by far one of the nicest features in ActiveRecord. But something about creating a complex named scope or a bunch of small named scopes for a single action in one of my controllers felt dirty. It felt like clutter. I knew I would never use those named scopes anywhere else, and they were solely for that search form. After a while all of these named scopes start overlapping and start sharing search logic. If you&amp;#8217;re extremely picky like me, your don&amp;#8217;t feel like your code is DRY. So how far do you go to break down a named scope? Breaking them down too much defeats their purpose, but not breaking them down enough seems to create redundant search logic. Searchlogic solved my problem with this, now all of my view specific search logic is where it should be, in my view.&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=Searchlogic%201.5.7%20%26%238211%3B%20Complex%20searching%20no%20longer%20a%20problem&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2008%2F11%2F30%2Fsearchlogic-1-5-7-complex-searching-no-longer-a-problem%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/fm8zKFy8jwi4BeV2WNkoH3emVsw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fm8zKFy8jwi4BeV2WNkoH3emVsw/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/fm8zKFy8jwi4BeV2WNkoH3emVsw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fm8zKFy8jwi4BeV2WNkoH3emVsw/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/Fa_-nAmmxgY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2008/11/30/searchlogic-1-5-7-complex-searching-no-longer-a-problem/#comments" thr:count="11" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2008/11/30/searchlogic-1-5-7-complex-searching-no-longer-a-problem/feed/atom/" thr:count="11" />
		<thr:total>11</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2008/11/30/searchlogic-1-5-7-complex-searching-no-longer-a-problem/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>benjohnson</name>
						<uri>http://www.binarylogic.com</uri>
					</author>
		<title type="html"><![CDATA[Tutorial: Easily migrate from restful_authentication to Authlogic]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/binarylogic/~3/q1cvE10lhMA/" />
		<id>0/2009/03/23/tutorial-easily-migrate-from-restful_authentication-to-authlogic</id>
		<updated>2009-04-17T03:35:03Z</updated>
		<published>2008-11-23T22:46:00Z</published>
		<category scheme="http://www.binarylogic.com" term="Authlogic" /><category scheme="http://www.binarylogic.com" term="migrate" /><category scheme="http://www.binarylogic.com" term="restful_authentication" /><category scheme="http://www.binarylogic.com" term="transition" />		<summary type="html"><![CDATA[I&#8217;ve been getting a lot of emails asking the best way to migrate from restful_authentication. Where it gets complicated is in the password encryption methods. Authlogic and restful_authentication use different methods. You don&#8217;t want to change this method because it will break backwards compatibility with your current passwords, meaning no one will be able to [...]]]></summary>
		<content type="html" xml:base="http://www.binarylogic.com/2008/11/23/tutorial-easily-migrate-from-restful_authentication-to-authlogic/">&lt;p&gt;I&amp;#8217;ve been getting a lot of emails asking the best way to migrate from restful_authentication. Where it gets complicated is in the password encryption methods. Authlogic and restful_authentication use different methods. You don&amp;#8217;t want to change this method because it will break backwards compatibility with your current passwords, meaning no one will be able to log into their account. Fear not, because I did all of the hard work for you&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;span id="more-253"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Use the same password algorithm as restful_authentication&lt;/h2&gt;
&lt;pre class="ruby"&gt;# app/models/user.rb
class User &amp;lt; ActiveRecord::Base
  acts_as_authentic do |c|
    c.act_like_restful_authentication = true
  end
end&lt;/pre&gt;
&lt;h2&gt;Transition to one of Authlogic password algorithms&lt;/h2&gt;
&lt;p&gt;The first thing you need to do is make sure your database field &amp;#8220;crypted_password&amp;#8221; and &amp;#8220;salt&amp;#8221; allow for the storage of at least 128 characters (assuming you are migrating to Sha512). restful_authentication uses Sha1 which is 40 characters. If you are limiting the size, you need to create a migration that looks similar to.&lt;/p&gt;
&lt;pre class="ruby"&gt;change_column :users, :crypted_password, :string, :limit =&amp;gt; 128,
  :null =&amp;gt; false, :default =&amp;gt; ""

change_column :users, :salt, :string, :limit =&amp;gt; 128,
  :null =&amp;gt; false, :default =&amp;gt; ""&lt;/pre&gt;
&lt;p&gt;Now just tell acts_as_authentic what you are doing:&lt;/p&gt;
&lt;pre class="ruby"&gt;# app/models/user.rb
class User
  acts_as_authentic do |c|
    c.transition_from_restful_authentication = true
  end
end&lt;/pre&gt;
&lt;p&gt;You could pass an optional argument to transition to any password algorithm you want. By default Authlogic uses the Sha512 algorithm, but let&amp;#8217;s say you wanted to transition to the BCrypt algorithm. No problem&lt;/p&gt;
&lt;pre class="ruby"&gt;# app/models/user.rb
class User &amp;lt; ActiveRecord::Base
  acts_as_authentic :transition_from_restful_authentication =&amp;gt; true,
    :crypto_provider =&amp;gt; Authlogic::CryptoProviders::BCrypt
end&lt;/pre&gt;
&lt;p&gt;For more information on BCrypt &lt;a href="http://www.binarylogic.com/2008/11/22/storing-nuclear-launch-codes-in-your-app-enter-bcrypt-for-authlogic"&gt;checkout my blog post about it&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;What&amp;#8217;s the difference?&lt;/h2&gt;
&lt;p&gt;act_like_restful_authentication will not change a thing, your users passwords will remain in the same format. From your database&amp;#8217;s perspective, it will be as if you are using restful_authentication.&lt;/p&gt;
&lt;p&gt;transition_from_restful_authentication starts changing your users passwords using the Authlogic passwords system that you specify with the :crypto_provider option. How does it do this? It&amp;#8217;s simple, every time a user successfully logs in and their password is encrypted with the restful_authentication algorithm it will update their password with the Authlogic algorithm. When a new account is created it will use the Authlogic algorithm. This allows your user base to slowly transition and allowing them to still be able to log in.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s it. I&amp;#8217;m not going to go into the Authlogic set up because &lt;a href="http://www.binarylogic.com/2008/11/3/tutorial-authlogic-basic-setup"&gt;I already have a tutorial on this&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let me know what you think or if you have any questions.&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=Tutorial%3A%20Easily%20migrate%20from%20restful_authentication%20to%20Authlogic&amp;amp;linkurl=http%3A%2F%2Fwww.binarylogic.com%2F2008%2F11%2F23%2Ftutorial-easily-migrate-from-restful_authentication-to-authlogic%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/lkCyiwfmG6S_cBx4CaQnnOJpYGU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lkCyiwfmG6S_cBx4CaQnnOJpYGU/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/lkCyiwfmG6S_cBx4CaQnnOJpYGU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lkCyiwfmG6S_cBx4CaQnnOJpYGU/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/q1cvE10lhMA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.binarylogic.com/2008/11/23/tutorial-easily-migrate-from-restful_authentication-to-authlogic/#comments" thr:count="9" />
		<link rel="replies" type="application/atom+xml" href="http://www.binarylogic.com/2008/11/23/tutorial-easily-migrate-from-restful_authentication-to-authlogic/feed/atom/" thr:count="9" />
		<thr:total>9</thr:total>
	<feedburner:origLink>http://www.binarylogic.com/2008/11/23/tutorial-easily-migrate-from-restful_authentication-to-authlogic/</feedburner:origLink></entry>
	</feed>
