<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: More Named Scope Awesomeness</title> <atom:link href="http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/feed/" rel="self" type="application/rss+xml" /><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/</link> <description>The Fastest Way to Launch Successful Software</description> <lastBuildDate>Thu, 19 Jan 2012 16:36:03 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Mobile WebSite</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8387</link> <dc:creator>Mobile WebSite</dc:creator> <pubDate>Wed, 07 Jul 2010 06:23:21 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8387</guid> <description>well any thing you are thinking of building a mobile site?  If yes, here are some guidelines for creating the mobile site. While initiating with this, you are advised to consider a lot of points, which includes both hardware and software. Though you will be able to create but knowledge over the two aspects is going to give you a clear and better platform. There are thousands of companies and hundreds of sets entering this mobile world every now and then. Every handset has specific features, when it comes to size of screen, operating system or the resolution. So just for your convenience, described below are the points to enhance both the looks and functionality of the website. The foremost point while building mobile sites is to consider the platform compatibility check, which urges you to design or create your website compatible enough with all of the operating systems as Windows, mobile Linux, iphone Symbian Os, Blackberry etc. So, build your mobile site compatible with all kinds of platforms.</description> <content:encoded><![CDATA[<p>well any thing you are thinking of building a mobile site?  If yes, here are some guidelines for creating the mobile site. While initiating with this, you are advised to consider a lot of points, which includes both hardware and software. Though you will be able to create but knowledge over the two aspects is going to give you a clear and better platform. There are thousands of companies and hundreds of sets entering this mobile world every now and then. Every handset has specific features, when it comes to size of screen, operating system or the resolution. So just for your convenience, described below are the points to enhance both the looks and functionality of the website.<br /> The foremost point while building mobile sites is to consider the platform compatibility check, which urges you to design or create your website compatible enough with all of the operating systems as Windows, mobile Linux, iphone Symbian Os, Blackberry etc. So, build your mobile site compatible with all kinds of platforms.</p> ]]></content:encoded> </item> <item><title>By: Tomasz Mazur</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8386</link> <dc:creator>Tomasz Mazur</dc:creator> <pubDate>Mon, 08 Jun 2009 17:11:35 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8386</guid> <description>I&#039;ve wrote something similiar, http://github.com/tomaszmazur/trixy_scopes/tree</description> <content:encoded><![CDATA[<p>I&#8217;ve wrote something similiar,<br /> <a href="http://github.com/tomaszmazur/trixy_scopes/tree" rel="nofollow">http://github.com/tomaszmazur/trixy_scopes/tree</a></p> ]]></content:encoded> </item> <item><title>By: Pathfinder Development &#187; A Look Back At Past Posts</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8385</link> <dc:creator>Pathfinder Development &#187; A Look Back At Past Posts</dc:creator> <pubDate>Tue, 16 Dec 2008 17:26:22 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8385</guid> <description>[...] project that included integrated design drafts, named-scope based reporting, and aggressive markup in the helpers had it&#039;s post-mortem this week. It was interesting to see how [...]</description> <content:encoded><![CDATA[<p>[...] project that included integrated design drafts, named-scope based reporting, and aggressive markup in the helpers had it&#8217;s post-mortem this week. It was interesting to see how [...]</p> ]]></content:encoded> </item> <item><title>By: Pathfinder Development &#187; I&#8217;m Cranky Because I&#8217;m Not Getting Enough REST</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8384</link> <dc:creator>Pathfinder Development &#187; I&#8217;m Cranky Because I&#8217;m Not Getting Enough REST</dc:creator> <pubDate>Fri, 22 Aug 2008 21:02:44 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8384</guid> <description>[...] that triggers an overlay, you can sort the columns. The advanced search is the flexible one I mention here, so it&#039;s got several Ajax calls associated with it as [...]</description> <content:encoded><![CDATA[<p>[...] that triggers an overlay, you can sort the columns. The advanced search is the flexible one I mention here, so it&#8217;s got several Ajax calls associated with it as [...]</p> ]]></content:encoded> </item> <item><title>By: Fredrik W</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8383</link> <dc:creator>Fredrik W</dc:creator> <pubDate>Wed, 16 Jul 2008 08:43:20 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8383</guid> <description>Here&#039;s some code that I came up with a week ago.http://pastie.org/231954Is basically takes an array of different scopes you wish to apply and injects them into the the model. I haven&#039;t thought of AND/OR joins yet though.</description> <content:encoded><![CDATA[<p>Here&#8217;s some code that I came up with a week ago.</p><p><a href="http://pastie.org/231954" rel="nofollow">http://pastie.org/231954</a></p><p>Is basically takes an array of different scopes you wish to apply and injects them into the the model. I haven&#8217;t thought of AND/OR joins yet though.</p> ]]></content:encoded> </item> <item><title>By: jtoy</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8382</link> <dc:creator>jtoy</dc:creator> <pubDate>Fri, 04 Jul 2008 11:59:25 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8382</guid> <description>There seems to be a bug in the code,  if I do a : Model.some_scoped_proxy.search_by(@searches) search_by will ignore the previous named_scopes. but if I do Model.search_by(@searches).some_scoped_proxy that will generate the proper sql.Also I had a seperate question, I tried making my own simple example based off your code.  I want a order named_proxy on all AR models, but my code doesn&#039;t work because when it calls column_names the lambda thinks its calling it on ActiveRecord::Base instead of the subclassed model. Why does this not work?class ActiveRecord::Base named_scope :order, lambda {&#124;column&#124; if column_names.include? column {:order =&gt; column} end }endAlso one other thing I noticed about scopes is that they dont override previous scopes, so for example Car.order(&#039;a&#039;).order(&#039;b&#039;) I would think that following the &quot;ruby way&quot; of least suprise, the order would on b, but its actually on a</description> <content:encoded><![CDATA[<p>There seems to be a bug in the code,  if I do a :<br /> Model.some_scoped_proxy.search_by(@searches)<br /> search_by will ignore the previous named_scopes.<br /> but if I do<br /> Model.search_by(@searches).some_scoped_proxy<br /> that will generate the proper sql.</p><p>Also I had a seperate question, I tried making my own simple example based off your code.  I want a order named_proxy on all AR models, but my code doesn&#8217;t work because when it calls column_names the lambda thinks its calling it on ActiveRecord::Base instead of the subclassed model. Why does this not work?</p><p>class ActiveRecord::Base<br /> named_scope <img src='http://pathfindersoftware.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder, lambda {|column|<br /> if column_names.include? column<br /> {:order =&gt; column}<br /> end<br /> }</p><p>end</p><p>Also one other thing I noticed about scopes is that they dont override previous scopes, so for example Car.order(&#8216;a&#8217;).order(&#8216;b&#8217;)<br /> I would think that following the &#8220;ruby way&#8221; of least suprise, the order would on b, but its actually on a</p> ]]></content:encoded> </item> <item><title>By: Noel Rappin</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8381</link> <dc:creator>Noel Rappin</dc:creator> <pubDate>Thu, 03 Jul 2008 22:26:42 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8381</guid> <description>James and Ben -- in the actual version of this, the user is limited to a specific subset (I think delete_all is excluded because it&#039;ll cause an error when composed with other scopes), plus there are some additional scopes tacked on to all the searches to limit users to objects that they have access to see. Although I probably could do a tighter job of limiting the searches.Tammer -- thanks for the kind words, we use a lot of thoughtbot tools on a daily basis here..</description> <content:encoded><![CDATA[<p>James and Ben &#8212; in the actual version of this, the user is limited to a specific subset (I think delete_all is excluded because it&#8217;ll cause an error when composed with other scopes), plus there are some additional scopes tacked on to all the searches to limit users to objects that they have access to see. Although I probably could do a tighter job of limiting the searches.</p><p>Tammer &#8212; thanks for the kind words, we use a lot of thoughtbot tools on a daily basis here..</p> ]]></content:encoded> </item> <item><title>By: Nick Kallen</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8380</link> <dc:creator>Nick Kallen</dc:creator> <pubDate>Tue, 01 Jul 2008 05:42:32 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8380</guid> <description>Love the articles. Inject is great:all_criteria.inject(scoped({})) do &#124;scope, criterion&#124; scope.scoped(search_by_criteria(*criterion).proxy_options) end</description> <content:encoded><![CDATA[<p>Love the articles. Inject is great:</p><p> all_criteria.inject(scoped({})) do |scope, criterion|<br /> scope.scoped(search_by_criteria(*criterion).proxy_options)<br /> end</p> ]]></content:encoded> </item> <item><title>By: Ben Nolan</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8379</link> <dc:creator>Ben Nolan</dc:creator> <pubDate>Sun, 29 Jun 2008 00:48:52 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8379</guid> <description>I&#039;m guessing you check that the operators are from a valid subset - so that people can&#039;t ask for the delete_all operator?</description> <content:encoded><![CDATA[<p>I&#8217;m guessing you check that the operators are from a valid subset &#8211; so that people can&#8217;t ask for the delete_all operator?</p> ]]></content:encoded> </item> <item><title>By: David</title><link>http://pathfindersoftware.com/2008/06/more-named-scope-awesomeness/#comment-8378</link> <dc:creator>David</dc:creator> <pubDate>Sat, 28 Jun 2008 13:26:09 +0000</pubDate> <guid isPermaLink="false">http://www.pathf.com/blogs/?p=995#comment-8378</guid> <description>Nice, I&#039;m just learning named_scope and used it in a project this week. I figured there was a way to generate anonymous scopes on the fly to simplify all my crazy conditional logic. This example really helps alot. cheers mate.</description> <content:encoded><![CDATA[<p>Nice, I&#8217;m just learning named_scope and used it in a project this week. I figured there was a way to generate anonymous scopes on the fly to simplify all my crazy conditional logic. This example really helps alot. cheers mate.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using memcached

Served from: pathfindersoftware.com @ 2012-02-10 00:59:24 -->
