<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>ColdFusion on Wheels</title>
      <description>Pipes Output</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=8701a02d9b531e30868b2616fa80eec8</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=8701a02d9b531e30868b2616fa80eec8&amp;_render=rss&amp;page=2"/>
      <pubDate>Thu, 01 Oct 2015 22:58:17 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>Easily build where clauses for the CFWheels ORM with this whereify helper</title>
         <link>http://chapmandu.com/2015/09/11/easily-build-where-clauses-for-the-cfwheels-orm-with-this-whereify-helper/</link>
         <description>Rather than stuff around building up a string when one&amp;#8217;s WHERE clause is conditional.. I make heavy use of this simple little helper which takes an array, and returns a finished string ready to pass to the CFWheels ORM. And &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/09/11/easily-build-where-clauses-for-the-cfwheels-orm-with-this-whereify-helper/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=344&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=344</guid>
         <pubDate>Fri, 11 Sep 2015 07:40:17 +0000</pubDate>
         <content:encoded><![CDATA[<p>Rather than stuff around building up a string when one&#8217;s WHERE clause is conditional.. I make heavy use of this simple little helper which takes an array, and returns a finished string ready to pass to the CFWheels ORM.</p>
<pre>
// helpers.cfm

/**
 * Hint
 * I surround each array element in brackets and return delimited by an operator
 */
public string function whereify(required array array, string operator=&quot;AND&quot;) {
	var loc = {};
	loc.array = [];
	for (loc.i=1; loc.i &lt;= ArrayLen(arguments.array); loc.i++) {
		loc.array[loc.i] = &quot;(#arguments.array[loc.i]#)&quot;;
	}
	return ArrayToList(loc.array, &quot; #arguments.operator# &quot;);
}
</pre>
<p>And here&#8217;s how I use it..</p>
<pre>
// YourController.cfc

var loc = {};
// build a sexy where clause array..
loc.where = [];
ArrayAppend(loc.where, &quot;foo = 'bar'&quot;);
if (StructKeyExists(params, &quot;slayer&quot;)) {
	ArrayAppend(loc.where, &quot;somecolumn IN (1,2,3)&quot;);
}

// use the whereify helper in your ORM call
// Produces: (foo = 'bar') AND (somecolumn IN (1,2,3))
users = model(&quot;User&quot;).findAll(whereify(loc.where));

// You can also specify an operator
// Produces: (foo = 'bar') OR (somecolumn IN (1,2,3))
users = model(&quot;User&quot;).findAll(whereify(loc.where, &quot;OR&quot;));
</pre><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/344/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=344&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/><img src="http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/8pCmoAojJD4" height="1" width="1" alt=""/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;amp;d=identicon&amp;amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>CFWheels 1.4.2 maintenance release</title>
         <link>http://feeds.cfwheels.org/~r/cfwheels/blog/~3/KNI931ev958/</link>
         <description>Today sees another maintenance release for the 1.4.x series Download 1.4.2 today to fix the following: Bug Fixes Fix for selecting distinct with calculated property &amp;#8211; [Edward Chanter, Per Djurner] Fixed so default values are applied to non persistent properties &amp;#8211; #519 [Andy Bellenie] Fixed missing var scope causing error on Lucee &amp;#8211; [Russ Michaels, Tom [&amp;#8230;]</description>
         <guid isPermaLink="false">http://cfwheels.org/blog/?p=383</guid>
         <pubDate>Mon, 31 Aug 2015 13:54:57 +0000</pubDate>
         <content:encoded><![CDATA[<p>Today sees another maintenance release for the 1.4.x series</p>
<p><a rel="nofollow" target="_blank" href="https://github.com/cfwheels/cfwheels/releases/download/v1.4.2/cfwheels.1.4.2.zip">Download 1.4.2 today</a> to fix the following:</p>
<h3>Bug Fixes</h3>
<ul>
<li>Fix for selecting distinct with calculated property &#8211; [Edward Chanter, Per Djurner]</li>
<li>Fixed so default values are applied to non persistent properties &#8211; #519 [Andy Bellenie]</li>
<li>Fixed missing var scope causing error on Lucee &#8211; [Russ Michaels, Tom King]</li>
<li>Don&#8217;t show debug info on AJAX requests &#8211; #496 [Leroy Mah, Per Djurner]</li>
<li>Fixed permissions issue with imageTag() when running on shared hosting &#8211; [Per Djurner]</li>
<li>Removed use of ExpandPath() in debug file since it was causing file permission issues &#8211; [Peter Hopman, Per Djurner]</li>
<li>Skip setting object property when NULL is passed in &#8211; #507 [Andy Bellenie, Per Djurner]</li>
<li>Fixed edge case issue with calling dynamic association methods &#8211; #501 [Dominik Hofer, Per Djurner]</li>
<li>Fixed lock name in onSessionEnd event &#8211; #499 [Per Djurner]</li>
<li>Ignore white space in the &#8220;where&#8221; argument to finders &#8211; #503 [Per Djurner]</li>
<li>Ignore spaces in the &#8220;keys&#8221; argument to hasManyCheckBox() and hasManyRadioButton() &#8211; [Song Lin, Per Djurner]</li>
<li>Skip running callbacks when validating uniqueness and similar situations &#8211; #492 [Andy Bellenie, Per Djurner]</li>
<li>Avoid plugin directory exception during first application load &#8211; #541 [Adam Chapman, Per Djurner]</li>
<li>Fix for using cfscript operators in &#8220;condition&#8221; and &#8220;unless&#8221; argument on ACF 8 &#8211; #531 [Per Djurner]</li>
<li>Fix for rolling back nested properties &#8211; #539 [James Gibson, Chris Peters, Per Djurner]</li>
<li>afterSave and afterCreate callbacks are not firing on nested objects &#8211; #525 [Adam Chapman, Chris Peters, Per Djurner]</li>
<li>Ability to pass in list to &#8220;includeBlank&#8221; argument on dateSelect() and similar functions &#8211; #502 [Thorsten Eilers, Per Djurner]</li>
<li>Ability to set attributes on the input element created by buttonTo() &#8211; [Per Djurner]</li>
<li>Added missing &#8220;onlyPath&#8221; argument to imageTag() &#8211; #508 [Per Djurner]</li>
<li>Corrected output of property labels in error messages &#8211; #494 [Andy Bellenie]</li>
</ul>
<p>Also don&#8217;t forget to check the <a rel="nofollow" target="_blank" href="http://docs.cfwheels.org/v1.4/docs/upgrading">upgrade notes</a>.</p>
<img src="http://feeds.feedburner.com/~r/cfwheels/blog/~4/KNI931ev958" height="1" width="1" alt=""/>]]></content:encoded>
         <category>Releases</category>
      </item>
      <item>
         <title>Deploying a Lucee application to an Amazon Elastic Beanstalk Environment</title>
         <link>http://chapmandu.com/2015/06/09/deploying-a-lucee-application-to-an-amazon-elastic-beanstalk-environment/</link>
         <description>If there was a piece of interwebs kit I would like to buy flowers, it would without doubt be Amazon&amp;#8217;s Elastic Beanstalk with autoscaling.. Couple it with the Lucee scripting language and I&amp;#8217;d happily take it home to meet my &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/06/09/deploying-a-lucee-application-to-an-amazon-elastic-beanstalk-environment/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=316&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=316</guid>
         <pubDate>Tue, 09 Jun 2015 06:27:51 +0000</pubDate>
         <content:encoded><![CDATA[<p>If there was a piece of interwebs kit I would like to buy flowers, it would without doubt be Amazon&#8217;s Elastic Beanstalk with autoscaling.. Couple it with the <a rel="nofollow" target="_blank" href="http://lucee.org/">Lucee</a> scripting language and I&#8217;d happily take it home to meet my parents..</p>
<p>After much experimentation and many iterations (failed attempts and hair-pulling), I&#8217;ve managed to deploy Lucee applications (with my fave framework.. <a rel="nofollow" target="_blank" href="http://www.cfwheels.org">CFWheels</a>) to the AWS Elastic Beanstalk platform and have it running reliably in production for a number of months.</p>
<p>My setup is a bit more complex than described below, but hopefully these bare bones will get you started on the path to automated utopia.. Those bare bones will result in a finished .war file that you can upload to EB using their deploy by file upload feature. You could also use the AWS command line tools, AWS toolkit for Eclipse, a Jenkins plugin or one of the many SaaS deployment platforms around.</p>
<p>I personally use <a rel="nofollow" target="_blank" href="https://jenkins-ci.org/">Jenkins</a> (on an AWS EC2 instance) to pull, build, test and deploy. I prefer this type of setup as there is much less margin for human error, and the resulting 60Mb+ war file is transferred within your Virtual Private Cloud rather than travelling across the interwebs if you were to manually upload it for every deployment.. oh, and it&#8217;s open source.</p>
<p>At a high level, I will outline how to download the Lucee server war file, combine your application&#8217;s code, and use some AWS sorcery to configure your Lucee application. There are some pre-requisites:</p>
<ul>
<li>The settings that you would normally configure in Lucee admin, should be in Application.cfc (See the Export feature in Lucee admin)</li>
<li>The commands to create the finished war file are written for Linux (If you&#8217;re Windows inclined , you could either &#8216;translate&#8217; them to Windows commands, try Cygwin or a Virtual Machine)</li>
<li>You&#8217;ll need a src/ directory in your application containing the files outlined below</li>
<li>An <a rel="nofollow" target="_blank" href="http://aws.amazon.com/">AWS</a> account with an empty Tomcat 8 <a rel="nofollow" target="_blank" href="http://aws.amazon.com/elasticbeanstalk/">Elastic Beanstalk</a> environment</li>
</ul>
<p>In a nutshell, what happens is the Lucee jars, your code and some config files are all copied to the &#8220;build&#8221; directory, then zipped into a sexy war file ready for upload/deploy to the Elastic Beanstalk environment.</p>
<p><strong>src directory</strong><br />
src/eb-tomcat/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/3e2fd99a8e19ec8acffd">web.xml</a><br />
src/eb-tomcat/<a rel="nofollow" target="_blank" href="http://tuckey.org/urlrewrite/">urlrewritefilter-4.0.3.jar</a><br />
src/eb-tomcat/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/faacf4dbe7ab77b12745">urlrewritefilter.xml</a><br />
src/eb-tomcat/.ebextensions<br />
src/eb-tomcat/.ebextensions/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/248142ca7f8c5825face">lucee-server.xml</a><br />
src/eb-tomcat/.ebextensions/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/2df65694a580617c0341">01-copy-lucee-server-xml.config</a></p>
<p><a rel="nofollow" target="_blank" href="https://chapmanic.files.wordpress.com/2015/06/src-directory-structure.png"><img class=" size-medium wp-image-332 alignleft" src="https://chapmanic.files.wordpress.com/2015/06/src-directory-structure.png?w=300&#038;h=203" alt="src-directory-structure" width="300" height="203"/></a></p>
<p>These are configuration files.. for a production application, you&#8217;ll need to provide your own lucee-server.xml and most likely your own rewrite rules in urlrewrite.xml. If you don&#8217;t need url rewriting, then remove all reference to them. The .ebextensions execute EB container commands.. the one provided simply copies your lucee-server.xml file into place. To create your finished war file, <code>cd</code> to your application&#8217;s root directory then run these commands. I&#8217;d suggest creating a shell script.. and if you feel adventurous, allow an &#8216;environment&#8217; option that will create different environment builds for your application&#8217;s deployment pipeline</p>
<pre>
# some vars..
DOWNLOADS_PATH=&quot;/tmp/downloads/&quot;
LUCEE_VERSION=&quot;4.5.1.000&quot;
LUCEE_WAR=&quot;lucee-$LUCEE_VERSION.war&quot;
LUCEE_WAR_PATH=&quot;$DOWNLOADS_PATH$LUCEE_WAR&quot;
FINISHED_WAR_PATH=&quot;/var/www/myapp/war/&quot;

# ensure the required packages are installed
sudo apt-get install unzip wget
# sudo yum install unzip wget # (or using yum)

# create required directories
mkdir build
mkdir -p $DOWNLOADS_PATH
mkdir -p $FINISHED_WAR_PATH
# only download the lucee war file once
if ! [ -e &quot;$LUCEE_WAR_PATH&quot; ]
then
  wget -O $LUCEE_WAR_PATH http://bitbucket.org/lucee/lucee/downloads/$LUCEE_WAR
fi

# unzip the lucee war file into the build utility directory
unzip $LUCEE_WAR_PATH -d build
rm -rf build/assets

# explicitly copy required code (this is cfwheels specific.. but just plonk in your own directory names)
cp -r config controllers customtags events images javascripts models plugins  stylesheets tests views wheels build
cp -r Application.cfc index.cfm rewrite.cfm root.cfm build
# remove any peksy files that you don't want deployed to production
rm -r build/favicon.ico build/License.txt
# copy config files
cp -r src/eb-tomcat/.ebextensions build
cp -f src/eb-tomcat/web.xml build/WEB-INF/web.xml
# copy tuckey url rewrite jar if required
cp src/eb-tomcat/urlrewritefilter-4.0.3.jar build/WEB-INF/lib/urlrewritefilter-4.0.3.jar
cp src/eb-tomcat/urlrewrite.xml build/WEB-INF/urlrewrite.xml

# this is how I force my app into 'production' mode.. again very cfwheels-centric
rm build/config/environment.cfm
echo 'set(environment=&quot;production&quot;);' &gt; build/config/environment.cfm
# create le war file
cd build &amp;&amp; zip -r -q $FINISHED_WAR_PATH&quot;app-production-master.war&quot; . &amp;&amp; cd ..
# cleanup
rm -r build
</pre>
<p>This should give you a <a rel="nofollow" target="_blank" href="https://chapmanic.files.wordpress.com/2014/08/borat_great_success-320x229.jpg">production ready</a> war file located at: build/app-production-master.war. Now you can manually upload your app-production-master.war and be on your way..</p>
<p>Some of my recommendations:</p>
<ul>
<li>Build in the cloud using Jenkins (or your choice of CI server)</li>
<li>Host the Lucee war file in your own S3 bucket.. you&#8217;re less at the mercy of 3rd parties connectivity issues.</li>
<li>You can easily incorporate additional jar files as per the tuckey rewrite tool.. just copy them into <code>build/WEB-INF/lib/</code></li>
</ul>
<p>Any suggestions, improvements &amp; feedback welcome.</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/316/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=316&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/><img src="http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/ZYZlaftXJwQ" height="1" width="1" alt=""/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;amp;d=identicon&amp;amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
         <media:content medium="image" url="https://chapmanic.files.wordpress.com/2015/06/src-directory-structure.png?w=300">
            <media:title type="html">src-directory-structure</media:title>
         </media:content>
      </item>
      <item>
         <title>Enforcing the use of routes in CFWheels</title>
         <link>http://chapmandu.com/2015/03/13/enforcing-the-use-of-routes-in-cfwheels/</link>
         <description>If you really like routing (you&amp;#8217;d find that really funny if you&amp;#8217;re Australian) and want to enforce their use in all linkTo(), urlFor() and startFormTag() function calls.. Do as I do.. Put the function below into your /controllers/Controller.cfc This overrides, &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/03/13/enforcing-the-use-of-routes-in-cfwheels/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=314&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=314</guid>
         <pubDate>Fri, 13 Mar 2015 05:07:20 +0000</pubDate>
         <content:encoded><![CDATA[<p>If you really like routing (you&#8217;d find that really funny if you&#8217;re Australian) and want to enforce their use in all linkTo(), urlFor() and startFormTag() function calls.. Do as I do..</p>
<p>Put the function below into your /controllers/Controller.cfc</p>
<pre>
&lt;!--- /controllers/Controller.cfc ---&gt;
&lt;cffunction name=&quot;urlFor&quot; access=&quot;public&quot; output=&quot;false&quot; hint=&quot;ensure routes are used for all urls&quot;&gt;
    &lt;cfif ! StructKeyExists(arguments, &quot;noroute&quot;) &amp;&amp; ! ( (StructKeyExists(url, &quot;controller&quot;) &amp;&amp; url.controller == &quot;wheels&quot;) || StructKeyExists(arguments, &quot;url&quot;) )&gt;
      &lt;cfif ! (StructKeyExists(arguments, &quot;route&quot;) &amp;&amp; Len(arguments.route) gt 0)&gt;
        &lt;cfthrow message=&quot;Please use a route rather than an action.. Thanks!&quot;&gt;
      &lt;/cfif&gt;
    &lt;/cfif&gt;
    &lt;cfreturn core.urlFor(argumentCollection=arguments)&gt;
  &lt;/cffunction&gt;
&lt;/code&gt;
</pre>
<p>This overrides, the core urlFor() method, checking for the existence of a route argument.. UNLESS, the controller is &#8220;wheels&#8221; which probably means you&#8217;re using the test framework or managing a plugin. There is also a way to bypass the route nazi.. by using the noroute=true arguments.</p>
<p>Happy <a rel="nofollow" target="_blank" href="http://www.urbandictionary.com/define.php?term=root">routing</a>.. Teehee!</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/314/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=314&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/><img src="http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/yBXnwFXIvpY" height="1" width="1" alt=""/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;amp;d=identicon&amp;amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>CFWheels Calculated Properties on Steroids using an afterFind Callback</title>
         <link>http://chapmandu.com/2015/01/15/cfwheels-calculated-properties-on-steroids-using-an-afterfind-callback/</link>
         <description>One limitation with using calculated properties in your CFWheels models is that one is limited to what can be achieved using SQL. CFML has almost infinite possibilities for formatting strings which simply cannot be done easily (or at all) in &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/01/15/cfwheels-calculated-properties-on-steroids-using-an-afterfind-callback/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=306&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=306</guid>
         <pubDate>Thu, 15 Jan 2015 23:51:09 +0000</pubDate>
         <content:encoded><![CDATA[<p>One limitation with using calculated properties in your CFWheels models is that one is limited to what can be achieved using SQL. CFML has almost infinite possibilities for formatting strings which simply cannot be done easily (or at all) in SQL.</p>
<p>A technique that I use to get around this limitation is to create new properties using an afterFind callback for both objects AND queries in a single callback. </p>
<p>In the code below I create two new properties, createdAtShort and createdAtLong which are just different date masks applied to the trusty createdat property. It&#8217;s a fairly simple example, but highlights the huge potential of keeping this type of logic in your model and out of your views. Hopefully this will get your brain moist.</p>
<pre>
&lt;!--- /models/User.cfc ---&gt;

&lt;cfcomponent extends=&quot;Model&quot; output=&quot;false&quot;&gt;

  &lt;cffunction name=&quot;init&quot;&gt;
    &lt;cfset afterFind(&quot;$$setStuffAfterFind&quot;)&gt;
  &lt;/cffunction&gt;

  &lt;cffunction name=&quot;$$setStuffAfterFind&quot; access=&quot;private&quot;&gt;
    &lt;cfif StructKeyExists(arguments, &quot;createdAt&quot;)&gt;
      &lt;cfset arguments.createdAtShort = DateFormat(arguments.createdAt, &quot;d/m/yy&quot;)&gt;
      &lt;cfset arguments.createdAtLong = DateFormat(arguments.createdAt, &quot;dddd, dd mmmm yyyy&quot;) &amp; &quot; &quot; &amp; TimeFormat(arguments.createdAt, &quot;hh:mmtt&quot;)&gt;
      &lt;cfreturn arguments&gt;
    &lt;/cfif&gt;
  &lt;/cffunction&gt;

&lt;/cfcomponent&gt;
</pre>
<p>Now you can call your model and the result should contain your new properties..</p>
<pre>
&lt;!--- /controllers/Users.cfc ---&gt;

&lt;cfset user = model(&quot;User&quot;).findOne()&gt;
&lt;cfset users = model(&quot;User&quot;).findAll(maxrows=5)&gt;

&lt;cfdump var=&quot;#user.properties()#&quot;&gt;
&lt;cfdump var=&quot;#users#&quot;&gt;
</pre>
<p>Notes:</p>
<ol>
<li>Avoid performing further database operations inside the callback when using findAll.. y&#8217;know the whole querying within a recordset loop thing..</li>
<li>afterFind callbacks are not called on included models. So.. <code>model("Company").findAll(include="Users")</code> won&#8217;t contain your new properties.</li>
</ol>
<p>UPDATE: <a rel="nofollow" target="_blank" href="https://twitter.com/_chrisdpeters" title="https://twitter.com/_chrisdpeters">Chris Peters</a> has since shown me the error of my ways.. it turns out that the arguments scope can be used for both queries and objects. This has simplified the entire concept considerably (and made &#8216;my&#8217; code look eerily similar to the official CFWheels <a rel="nofollow" target="_blank" href="http://cfwheels.org/docs/1-3/chapter/object-callbacks" title="http://cfwheels.org/docs/1-3/chapter/object-callbacks">docs</a>! The code and description above have been modified to use arguments scope.</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/306/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=306&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/><img src="http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/Kf-gcKCvnXE" height="1" width="1" alt=""/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;amp;d=identicon&amp;amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>Run your CFWheels database migrations automatically on application start</title>
         <link>http://chapmandu.com/2014/11/06/run-your-cfwheels-database-migrations-automatically-on-application-start/</link>
         <description>It&amp;#8217;s no secret that I&amp;#8217;m a massive fan of the Coldfusion on Wheels framework.. and there are a couple of tools that I use in my deployment process that are invaluable to me. One of those is the DBMigrate plugin. &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2014/11/06/run-your-cfwheels-database-migrations-automatically-on-application-start/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=299&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=299</guid>
         <pubDate>Thu, 06 Nov 2014 22:00:20 +0000</pubDate>
         <content:encoded><![CDATA[<p>It&#8217;s no secret that I&#8217;m a massive fan of the <a rel="nofollow" target="_blank" href="http://cfwheels.org" title="Coldfusion on Wheels">Coldfusion on Wheels</a> framework.. and there are a couple of tools that I use in my deployment process that are invaluable to me.</p>
<p>One of those is the <a rel="nofollow" target="_blank" href="http://cfwheels.org/plugins/listing/28" title="DBMigrate">DBMigrate</a> plugin. I recently came up with a way to automatically migrate to the latest database version when the application first starts.</p>
<p>This can be useful/essential when:</p>
<ul>
<li>Your deployment process doesn&#8217;t use post-deploy hooks</li>
<li>You want to make your application more portable</li>
<li>You want to simplify your deployment script</li>
</ul>
<p>Essentially, it calls a couple of the plugin&#8217;s methods whilst doing a little array-fu.</p>
<p><strong>/events/onapplicationstart.cfm</strong></p>
<pre>
&lt;cfscript&gt;
// migrate database
_dbm = {}
// create a pointer to the dbmigrate plugin
_dbm.plugin = application.wheels.plugins.dbmigrate
// create an array of available migrations sorted by version in descending order
_dbm.available = []
for(item in _dbm.plugin.getAvailableMigrations()){
_dbm.available.Append(item.version)
}
ArraySort(_dbm.available, &quot;numeric&quot;, &quot;desc&quot;)
// migrate to the most recent version
_dbm.plugin.migrateTo(_dbm.available[1])
&lt;/cfscript&gt;
</pre>
<p>There are a few caveats:</p>
<ul>
<li>It will execute every time the application loads OR is manually reloaded via the reload=true parameter (though it&#8217;s fairy lightweight when there are no migrations to execute)</li>
<li>It will execute on every server in your cluster</li>
<li>There is (currently) no error handling</li>
<li>It could disable your application if your migrations fail</li>
</ul><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/299/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=299&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/><img src="http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/M21EBo5kclM" height="1" width="1" alt=""/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;amp;d=identicon&amp;amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>Passing a list of strings to CFWheels’ findAll() where argument</title>
         <link>http://chapmandu.com/2014/08/08/passing-a-list-of-strings-to-cfwheels-findall-where-argument/</link>
         <description>Use the ListQualify() function to pass a list of strings to the where argument in CFWheels ORM finders. ListQualify() encloses each list element in with the string specified (in this case, a single quote). Without it, CFWheels interprets the list &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2014/08/08/passing-a-list-of-strings-to-cfwheels-findall-where-argument/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=282&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=282</guid>
         <pubDate>Fri, 08 Aug 2014 05:30:00 +0000</pubDate>
         <content:encoded><![CDATA[<p>Use the <code>ListQualify()</code> function to pass a list of strings to the <code>where</code> argument in CFWheels ORM finders. <code>ListQualify()</code> encloses each list element in with the string specified (in this case, a single quote). Without it, CFWheels interprets the list as a single value.</p>
<pre>
&lt;cfscript&gt;
names = &quot;Foo,Bar&quot;;
users = model(&quot;User&quot;).findAll(where=&quot;firstname IN ('#names#')&quot;);
/*
 * Generates SQL Query.. Not so good
SELECT firstname, lastname FROM users WHERE firstname IN ('Foo,Bar')
*/

users = model(&quot;User&quot;).findAll(where=&quot;firstname IN (#ListQualify(names, &quot;'&quot;)#)&quot;);
/* 
 * Generates SQL Query. Great success!
SELECT firstname, lastname FROM users WHERE firstname IN ('Foo','Bar')
*/
&lt;/cfscript&gt;
</pre>
<p><a rel="nofollow" target="_blank" href="https://chapmanic.files.wordpress.com/2014/08/borat_great_success-320x229.jpg">Great success!</a></p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/282/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=282&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/><img src="http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/rBl1DTXiyrw" height="1" width="1" alt=""/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;amp;d=identicon&amp;amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>The Importance of URL Rewriting</title>
         <link>http://flexicons.blogspot.com/2013/05/the-importance-of-url-rewriting.html</link>
         <description>I am terrible about explaining things sometimes, and lately I've been working with a client on URL rewriting. I've done a lot of techno-speak but I'm not sure that I have really explained in laymans terms what URL rewriting is, and why it's important.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;What is it?&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;When you go to your About us page on your web site right now, if you typed in the whole address into your browser, it might look something like this:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/index.cfm/sitepages/show/2&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;That URL doesn't tell us anything about the page, and it's very hard to remember. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Wouldn't it be better to have that URL be this?&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/About-Us&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;That is URL rewriting. It's the process of making your page names descriptive, instead of cryptic.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;When we start rewriting those URL's, a great thing happens... you can now &lt;i&gt;anticipate&lt;/i&gt; what a page will be. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Want to find out about services? My guess would be the URL would be:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/services&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Want to go to the contact us page? My guess would be:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/Contact-Us&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Best of all, those guesses would be right! So by rewriting the URL's, the first thing we've done is make those pages easy to remember. If I'm on my smart phone and don't want to have to go to the home page of your site, to get to your contact page, I can now easily remember how to get there. With so many people using the browsers on their phones, making those pages easy to get to is going to increase your traffic.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;But URL rewriting isn't just for people, it's for search engines too. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Google and other search engines give your pages a &quot;rank.&quot;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;When you do a search, the pages with the highest rankings show up first. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;By making the name of the page descriptive of the content, your rank will improve, and therefore your pages will show up higher in searches. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;So hopefully that is a simple explanation of what URL rewriting is, and why it's so important. If you are serious about SEO, URL rewriting is a smart thing to do.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Implementing URL rewriting in CFWheels&lt;/b&gt;&lt;br /&gt;This is just how I do it in CFWheels. I'd really like to hear how others are accomplishing it to see if I can improve on the method.&lt;br /&gt;&lt;br /&gt;Let's create a hypothetical table called &quot;sitepages.&quot;&lt;br /&gt;In that table, I create a field for the title of the page and a unique field for the &quot;slug.&quot;&lt;br /&gt;&lt;br /&gt;In the sitepages model, I add a beforeSave callback.&lt;br /&gt;&amp;lt;!---Add this to the models init method---&amp;gt;&lt;br /&gt;&amp;lt;cfset beforeSave(&quot;checktheslug&quot;)&amp;gt;&lt;br /&gt;&lt;br /&gt;Then, I create the &quot;checktheslug&quot; function:&lt;br /&gt;&lt;br /&gt; If the user doesn't specify a slug, then the slug takes the title of the page, replaces spaces with hyphens, and then strips out any extraneous characters like quotation marks, exclamation points, etc.&lt;br /&gt;&lt;br /&gt;Then all I have to do is set up a route, and I'm in business:&lt;br /&gt;&amp;lt;!---Add this to the routes ---&amp;gt;&lt;br /&gt;addRoute(name=&quot;sitepages&quot;, pattern=&quot;pages/[slug]&quot;, controller=&quot;sitepages&quot;, action=&quot;show&quot;); &lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/JE07sztLGfQ&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Cathy Shapiro</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-140258686176088525.post-1512943589802362190</guid>
         <pubDate>Wed, 01 May 2013 12:37:00 +0000</pubDate>
      </item>
      <item>
         <title>HTML5 Video</title>
         <link>http://flexicons.blogspot.com/2012/12/html5-video.html</link>
         <description>I recently had to post a lot of videos on a cfwheels site.&lt;br /&gt;The videos needed to be behind a login, so to achieve that I put a little function in the Controllers/Controller.cfc. I was passing the videoid in the url so I just cued off that. &lt;br /&gt;&lt;br /&gt; So then I just set a filter on my sitepages controller to run on the page.&lt;br /&gt;&amp;lt;cfset filters(through=&quot;memberloginRequired&quot;, only=&quot;show&quot;)&amp;gt;&lt;br /&gt;&lt;br /&gt;I had to report on the videos, so for the video playback, I used the Projekktor video player. It has a flash fallback and it had a tracking plugin that I bought to keep track of all player events and states.&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.projekktor.com/docs/plugins_tracking&quot;&gt;http://www.projekktor.com/docs/plugins_tracking&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To make the video available to the most people, we used mp4 and ogv&lt;br /&gt;I had a little trouble figuring out how everything has to fit together, but basically you have to go into IIS and add support for the video types, so you have to add MIME types for video/mp4 and video/ogg with an ogv extension. This will add the following to your web.config file just under your rewrite tag: &lt;br /&gt;&lt;br /&gt;One problem I ran into was browser's not recognizing the mp4 so I ended up taking the type out of that in the video page script: &lt;br /&gt; Altogether adding html5 videos was very nice. However, we are still having some people reporting problems, so next I'm going to write a little script to help with debugging. I will try to post that later.&lt;img src=&quot;http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/B6aMSffbL_s&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Cathy Shapiro</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-140258686176088525.post-1847472339660127692</guid>
         <pubDate>Tue, 04 Dec 2012 10:27:00 +0000</pubDate>
      </item>
      <item>
         <title>Ensuring Full Unit Test Coverage In Your CFWheels App</title>
         <link>http://chapmandu.com/2012/07/12/ensuring-full-unit-test-coverage-in-your-cfwheels-app/</link>
         <description>Ensuring that you have unit tested all (or most) of your code in your CFWheels app is an important part of any test suite. As you hopefully know by now, the CFWheels framework features an in-built unit test framework. The &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2012/07/12/ensuring-full-unit-test-coverage-in-your-cfwheels-app/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=257&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=257</guid>
         <pubDate>Thu, 12 Jul 2012 01:32:21 +0000</pubDate>
         <content:encoded><![CDATA[<p>Ensuring that you have unit tested all (or most) of your code in your CFWheels app is an important part of any test suite. As you hopefully know by now, the CFWheels framework features an in-built unit test framework.</p>
<p>The code below is a test itself, that will scan your controllers, models and views folders and make sure that you have a corresponding &#8220;test&#8221; cfc for each. If it discovers that a test is missing, it will fail.. so your app will not pass unless it has full test coverage.</p>
<p>To get it working, just copy the code below and save it into a file in <code>/tests/TestsExist.cfc</code> (or anywhere under the <code>tests</code> folder actually). You can retro-fit it to any app, though you may need to re-organise your test files somewhat.</p>
<p>There are some conventions that you need to follow to have it work properly, but I consider this being well organised (and you should be used to conventions by now). Your folder structure under <code>/myapp/tests/</code> should look like this..<a rel="nofollow" target="_blank" href="http://chapmanic.files.wordpress.com/2012/07/testsdirs.jpg"><img src="http://chapmanic.files.wordpress.com/2012/07/testsdirs.jpg?w=584" alt="" class="alignleft size-full wp-image-258"/></a>. Say you have a <code>Login.cfc</code> controller, your controller test cfcs themselves should be named like this <code>TestLogin.cfc</code>.. but you could also have multiple test files for your <code>Login.cfc</code>, just as long as the file BEGINS with &#8220;TestLogin&#8221;, eg: <code>TestLoginRedirects.cfc</code>, <code>TestLoginBusinessLogic.cfc</code>.. you get the idea.</p>
<p>The same goes for models and views. There is much one could do to improve/re-factor/customise this code, but it will hopefully catch anything you may have forgotten to test. Feel free to contribute to this <a rel="nofollow" target="_blank" href="https://github.com/chapmandu/cfwheels-hastests">project on GitHub</a>.</p>
<p>So to summarise:</p>
<ul>
<li>Re-organise your folders as per the example above</li>
<li>Re-name your test cfc files using <code>Test{YourControllerName}.cfc</code></li>
<li>Copy the code into a TestsExist.cfc file under the <code>/tests/</code> folder</li>
<li>Run your unit tests</li>
</ul>
<pre>
&lt;cfcomponent extends=&quot;wheelsMapping.Test&quot;&gt;
	
	&lt;cffunction name=&quot;setup&quot;&gt;
		&lt;cfset testsPath = ExpandPath(&quot;tests&quot;)&gt;
		&lt;cfset controllersPath = ExpandPath(&quot;controllers&quot;)&gt;
		&lt;cfset modelsPath = ExpandPath(&quot;models&quot;)&gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;test_00_setup_and_teardown&quot;&gt;
		&lt;cfset assert(&quot;true&quot;)&gt;
	&lt;/cffunction&gt;

	&lt;cffunction name=&quot;test_01_all_controller_tests_exist&quot;&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#controllersPath#&quot; filter=&quot;*.cfc&quot; name=&quot;controllers&quot; /&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#testsPath &amp; '/' &amp; 'controllers'#&quot; filter=&quot;*.cfc&quot; name=&quot;controllerTests&quot; /&gt;
		&lt;cfset assert(&quot;controllerTests.recordCount gt 0&quot;)&gt;
		&lt;cfloop query=&quot;controllers&quot;&gt;
			&lt;cfif ListFindNoCase(&quot;Controller.cfc,Wheels.cfc&quot;, controllers.name) eq 0&gt;
				&lt;cfset abbrev = ListFirst(controllers.name, &quot;.&quot;)&gt;
				&lt;cfset isTestFileFound = false&gt;
				&lt;cfloop query=&quot;controllerTests&quot;&gt;
					&lt;cfif FindNoCase(&quot;Test&quot; &amp; abbrev, controllerTests.name) gt 0&gt;
						&lt;cfset isTestFileFound = true&gt;
						&lt;cfbreak&gt;
					&lt;/cfif&gt;
				&lt;/cfloop&gt;
				&lt;cfset assert(&quot;isTestFileFound&quot;, &quot;controllers.name&quot;)&gt;
			&lt;/cfif&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;test_02_all_model_tests_exist&quot;&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#modelsPath#&quot; filter=&quot;*.cfc&quot; name=&quot;models&quot; /&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#testsPath &amp; '/' &amp; 'models'#&quot; filter=&quot;*.cfc&quot; name=&quot;modelTests&quot; /&gt;
		&lt;cfset assert(&quot;modelTests.recordCount gt 0&quot;)&gt;
		&lt;cfloop query=&quot;models&quot;&gt;
			&lt;cfif ListFindNoCase(&quot;Model.cfc,Wheels.cfc&quot;, models.name) eq 0&gt;
				&lt;cfset abbrev = ListFirst(models.name, &quot;.&quot;)&gt;
				&lt;cfset isTestFileFound = false&gt;
				&lt;cfloop query=&quot;modelTests&quot;&gt;
					&lt;cfif FindNoCase(&quot;Test&quot; &amp; abbrev, modelTests.name) gt 0&gt;
						&lt;cfset isTestFileFound = true&gt;
						&lt;cfbreak&gt;
					&lt;/cfif&gt;
				&lt;/cfloop&gt;
				&lt;cfset assert(&quot;isTestFileFound&quot;, &quot;models.name&quot;)&gt;
			&lt;/cfif&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;

	&lt;cffunction name=&quot;test_03_all_view_tests_exist&quot;&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#controllersPath#&quot; filter=&quot;*.cfc&quot; name=&quot;controllers&quot; /&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#testsPath &amp; '/' &amp; 'views'#&quot; filter=&quot;*.cfm&quot; name=&quot;viewTests&quot; /&gt;
		&lt;cfset assert(&quot;viewTests.recordCount gt 0&quot;)&gt;
		&lt;cfloop query=&quot;controllers&quot;&gt;
			&lt;cfif ListFindNoCase(&quot;Controller.cfc,Wheels.cfc&quot;, controllers.name) eq 0&gt;
				&lt;cfset abbrev = ListFirst(controllers.name, &quot;.&quot;)&gt;
				&lt;cfset isTestFileFound = false&gt;
				&lt;cfloop query=&quot;viewTests&quot;&gt;
					&lt;cfif FindNoCase(&quot;Test&quot; &amp; abbrev, viewTests.name) gt 0&gt;
						&lt;cfset isTestFileFound = true&gt;
						&lt;cfbreak&gt;
					&lt;/cfif&gt;
				&lt;/cfloop&gt;
				&lt;cfset assert(&quot;isTestFileFound&quot;, &quot;controllers.name&quot;)&gt;
			&lt;/cfif&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;

	&lt;cffunction name=&quot;teardown&quot;&gt;
	&lt;/cffunction&gt;

&lt;/cfcomponent&gt;
</pre><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/257/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=257&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/><img src="http://feeds.feedburner.com/~r/cfwheels/bloggers/~4/PC8ph6DEGrY" height="1" width="1" alt=""/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;amp;d=identicon&amp;amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/07/testsdirs.jpg"/>
      </item>
   </channel>
</rss>
<!-- fe7.yql.bf1.yahoo.com compressed/chunked Thu Oct  1 22:58:10 UTC 2015 -->
