<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Typecasting and database functions</title><link>https://sourceforge.net/p/sorting-made-easy/wiki/Typecasting%2520and%2520database%2520functions/</link><description>Recent changes to Typecasting and database functions</description><atom:link href="https://sourceforge.net/p/sorting-made-easy/wiki/Typecasting%20and%20database%20functions/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 28 Sep 2015 17:33:54 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sorting-made-easy/wiki/Typecasting%20and%20database%20functions/feed" rel="self" type="application/rss+xml"/><item><title>Typecasting and database functions modified by Sheba Liveoak</title><link>https://sourceforge.net/p/sorting-made-easy/wiki/Typecasting%2520and%2520database%2520functions/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sheba Liveoak</dc:creator><pubDate>Mon, 28 Sep 2015 17:33:54 -0000</pubDate><guid>https://sourceforge.net083a4c245a642779d4e3363d344833e282cbfe8c</guid></item><item><title>Typecasting and database functions modified by Sheba Liveoak</title><link>https://sourceforge.net/p/sorting-made-easy/wiki/Typecasting%2520and%2520database%2520functions/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -3,7 +3,7 @@
 Controller:

     :::ruby
-    @users = User.select("income::BigInt AS bg_income").sort(params[:sort], "bg_income ASC")
+    @users = User.select("income::BigInt AS bg_income").sorted(params[:sort], "bg_income ASC")

 View:

@@ -15,7 +15,7 @@
 Controller:

     :::ruby
-    @users = User.select("inet_aton(`ip_address`) AS in_ip").sort(params[:sort], "in_ip ASC")
+    @users = User.select("inet_aton(`ip_address`) AS in_ip").sorted(params[:sort], "in_ip ASC")

 View:

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sheba Liveoak</dc:creator><pubDate>Mon, 28 Sep 2015 17:33:54 -0000</pubDate><guid>https://sourceforge.netce46d8cc45c32f57f29503f11efcccc469750a6e</guid></item><item><title>Typecasting and database functions modified by Sheba Liveoak</title><link>https://sourceforge.net/p/sorting-made-easy/wiki/Typecasting%2520and%2520database%2520functions/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,23 +1,23 @@
-## Typecasting
+### Typecasting

-Controller
+Controller:

     :::ruby
     @users = User.select("income::BigInt AS bg_income").sort(params[:sort], "bg_income ASC")

-View
+View:

     :::erb
     &amp;lt;%= link_to_sorted "Income", 'bg_income' %&amp;gt;

-## Database functions
+### Database functions

-Controller
+Controller:

     :::ruby
     @users = User.select("inet_aton(`ip_address`) AS in_ip").sort(params[:sort], "in_ip ASC")

-View
+View:

     :::erb
     &amp;lt;%= link_to_sorted "IP address", 'in_ip' %&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sheba Liveoak</dc:creator><pubDate>Mon, 28 Sep 2015 17:33:53 -0000</pubDate><guid>https://sourceforge.netafb4578c00d979e12aa067bae9dc8fe3a2bf72aa</guid></item><item><title>Typecasting and database functions modified by Sheba Liveoak</title><link>https://sourceforge.net/p/sorting-made-easy/wiki/Typecasting%2520and%2520database%2520functions/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="typecasting"&gt;Typecasting&lt;/h2&gt;
&lt;p&gt;Controller&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="vi"&gt;@users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;User&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"income::BigInt AS bg_income"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:sort&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"bg_income ASC"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;View&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="x"&gt;&amp;lt;th class="ui-state-default"&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="n"&gt;link_to_sorted&lt;/span&gt; &lt;span class="s2"&gt;"Income"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bg_income'&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;&lt;span class="x"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h2 id="database-functions"&gt;Database functions&lt;/h2&gt;
&lt;p&gt;Controller&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="vi"&gt;@users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;User&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"inet_aton(`ip_address`) AS in_ip"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:sort&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"in_ip ASC"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;View&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="x"&gt;&amp;lt;th class="ui-state-default"&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="n"&gt;link_to_sorted&lt;/span&gt; &lt;span class="s2"&gt;"IP address"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'in_ip'&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;&lt;span class="x"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sheba Liveoak</dc:creator><pubDate>Mon, 28 Sep 2015 17:33:53 -0000</pubDate><guid>https://sourceforge.nete35985689e3b1d0cd64dee8d723b82cf234cec7a</guid></item></channel></rss>