<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amithtg  on Medium]]></title>
        <description><![CDATA[Stories by Amithtg  on Medium]]></description>
        <link>https://medium.com/@amithtg?source=rss-b41e5aa17cdf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nqLO7YRvHPuBMS4x</url>
            <title>Stories by Amithtg  on Medium</title>
            <link>https://medium.com/@amithtg?source=rss-b41e5aa17cdf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:58:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amithtg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Local CI in Rails 8.1 (Beta): The Feature That Quietly Changes Everything]]></title>
            <link>https://amithtg.medium.com/local-ci-in-rails-8-1-beta-the-feature-that-quietly-changes-everything-5c216234f682?source=rss-b41e5aa17cdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c216234f682</guid>
            <dc:creator><![CDATA[Amithtg ]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 16:15:25 GMT</pubDate>
            <atom:updated>2025-11-23T16:15:25.893Z</atom:updated>
            <content:encoded><![CDATA[<p>Every new Rails version brings something interesting, but Rails 8.1 includes a feature that feels small on paper yet makes a noticeable difference the moment you start using it: <strong>Local CI</strong>.</p><p>It’s easy to overlook because it doesn’t scream for attention like Turbo, ActionCable, or Hotwire did. But if you’re someone who pushes code, waits for CI, waits again after it fails, and then waits some more… this feature will feel like a breath of fresh air.</p><p>Local CI takes a process we’ve always relied on external services for and brings it directly onto the developer’s machine — with almost no setup and zero fuss.</p><h3>Why Rails Is Introducing Local CI</h3><p>Most of us depend on GitHub Actions, GitLab CI, CircleCI, or some other cloud CI tool. And we’ve grown used to the delays:</p><ul><li>Push code</li><li>Wait for CI</li><li>Fix something trivial</li><li>Push again</li><li>Wait again</li></ul><p>But the surprising truth is that <strong>our own machines are now faster than many cloud CI runners</strong>.</p><h3>How Local CI Works</h3><p>Rails 8.1 adds two things:</p><ol><li>A small Ruby DSL inside config/ci.rb</li><li>A new command: bin/ci</li></ol><p>Instead of writing YAML or managing custom runners, everything is defined using simple Ruby.</p><p>Here’s the default CI configuration Rails gives you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrbMi5ngh3iMENxP5VhvVw.png" /></figure><p>Running bin/ci executes each step in order, stopping at the first failure—just like a normal CI pipeline.</p><h3>Breaking Down What Local CI Actually Does</h3><h3>1. Environment Setup</h3><p>Ensures dependencies and the test database are ready. This eliminates the “works on my machine” issue many teams face.</p><h3>2. Ruby Style Checks</h3><p>Runs Rubocop to enforce consistent style and catch early mistakes. The moment you miss a space, break a rule, or write inefficient code, you’ll know.</p><h3>3. Security Checks</h3><p>Rails includes three security scanners by default:</p><ul><li>Bundler Audit</li><li>Importmap Audit</li><li>Brakeman</li></ul><p>These catch dependency vulnerabilities, Rails-specific issues, and unsafe code patterns. It’s the kind of protection developers should always run, but often forget.</p><h3>4. Rails Test Suite</h3><p>Runs your full test suite locally, much faster than a typical cloud CI runner.</p><h3>5. Seed Verification</h3><p>One of the most overlooked steps in CI.<br> If your seeds fail to load in the test environment, Local CI catches it immediately, long before you open a pull request.</p><h3><strong>A Real-World Example: Local CI Saving Time</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*hK6yWYNG4Bbeiao4Y3BWYw.png" /></figure><p>Run Local CI: bin/ci</p><p>Rails will execute the full built-in CI pipeline.<br>And here’s what happens: <strong>Brakeman flags the vulnerability immediately.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*dVUWKA6TtGjpZK0t2WYjMA.png" /></figure><p>You didn’t write a test.<br> You didn’t push anything.<br> You didn’t wait for GitHub Actions.</p><p>Local CI caught the mistake before the code ever left your machine.</p><p>Fix the Code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*94825t1-BZvNPKEGpt5KHg.png" /></figure><p>Run Local CI Again: bin/ci</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*u26-B_YF--uxSwP6HXH2zA.png" /></figure><p>Local CI doesn’t just run your tests.<br> It layers multiple protections:</p><ul><li>Rubocop → style, performance, bad patterns</li><li>Bundler Audit → gem vulnerabilities</li><li>Importmap Audit → JS vulnerabilities</li><li>Brakeman → real security issues</li><li>Seed Replant → broken data + invalid models</li><li>Setup → missing dependencies</li></ul><p>Even if you write <strong>zero tests</strong>, Local CI still catches:</p><ul><li>SQL injection</li><li>Unsafe params</li><li>Broken seeds</li><li>Vulnerable gems</li><li>Outdated JS dependencies</li><li>Style violations</li><li>Performance anti-patterns</li><li>Rails-specific security issues</li></ul><p>All <em>before pushing your code</em>.</p><p>It’s the fastest, cheapest, most painless way to catch everyday mistakes.</p><p>Local CI isn’t here to kill cloud CI.<br>It’s here to make sure your code is clean before the cloud ever sees it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c216234f682" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Data Analysis (EDA)]]></title>
            <link>https://amithtg.medium.com/exploratory-data-analysis-eda-727064df4117?source=rss-b41e5aa17cdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/727064df4117</guid>
            <dc:creator><![CDATA[Amithtg ]]></dc:creator>
            <pubDate>Sun, 26 Oct 2025 15:26:07 GMT</pubDate>
            <atom:updated>2025-10-26T15:26:07.979Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is EDA?</h3><p>Imagine you just received a huge Excel file full of numbers and names — and you have no clue what’s inside.<br> Before you make charts or predictions, you first need to <strong>understand</strong> your data — what it looks like, what’s missing, and what patterns might be hiding in it.</p><h3>Why Do We Need EDA?</h3><p>EDA helps you:</p><ul><li>Find <strong>missing or wrong values</strong></li><li>Understand <strong>patterns and trends</strong></li><li>See how <strong>different columns are connected</strong></li><li>Prepare your data for modeling or visualization</li></ul><p>Without EDA, you’re basically guessing. With EDA, you <strong>understand your data before trusting it</strong>.</p><h3>Example Dataset: Demographic Data</h3><p>We’ll use a simple dataset that will have below columns</p><p>Country NameCountry Code BirthRate InternetUsers (%) IncomeGroup</p><h3>Step 1: Look at Your Data (Data Collection &amp; Loading)</h3><p>We’ll use <strong>Python</strong> and <strong>pandas</strong>, a library for working with data easily.<br>You might get data from:</p><ul><li>A <strong>CSV or Excel</strong> file</li><li>A <strong>database</strong></li><li>Or an <strong>online source (API)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMUWjUK-vCewCDgSDi4iWA.png" /></figure><h3>Step 2: Take a Quick Peek (Data Inspection)</h3><p>Exploring the data:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3l4lVrb2lj8Sceo__1Dwg.png" /></figure><p>This shows:</p><ul><li>How many rows and columns are there</li><li>What type of data each column has (numbers, text, etc.)</li><li>If there are missing (empty) values</li><li>Basic statistics like average and range for numeric columns</li></ul><h3>Step 3: Clean Up the Mess (Data Cleaning)</h3><p>Real-world data is <strong>never perfect</strong>.<br> You might find:</p><ul><li>Missing values</li><li>Duplicate rows</li><li>Wrong formats (like numbers stored as text)</li><li>Inconsistent names</li></ul><p>You clean all that up here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgR5JAK4dKpQa_GGqieyvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vgoW44dJLPAobOAX3oNdmA.png" /></figure><h3>Step 4: Univariate Analysis</h3><p>we start exploring <strong>one column at a time </strong>and Understand how each column looks like:-<br>We can see which countries have higher or lower birth rates.<br>Usually, lower-income countries have higher birth rates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CDTHHYDsBY9NgLLq8qzWgg.png" /></figure><h3>Step 5: Compare Two Things (Bivariate Analysis)</h3><p>Here we check if <strong>two things are related</strong>. Understanding Relationship between <strong>Internet Usage</strong> and <strong>Birth Rate</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vBTH74B0iLTe4-1dmMdXA.png" /></figure><h3>Step 6: Multivariate Analysis</h3><p>Here we bring in <strong>three or more</strong> columns at once.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqOSTJ8W-aPgmGRyaJYCJA.png" /></figure><h3>Step 7: Find Relationships Between Numbers (Correlation)</h3><p><strong>Correlation</strong> simply means <strong>how two things move together</strong> — whether they rise and fall at the same time or go in opposite directions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sckshHWmSq43uC19-5jlMg.png" /></figure><p>If BirthRate and InternetUsers (%) are <strong>negatively correlated</strong>, it means that when internet usage goes up, birth rate usually goes down.<br><em>This step is like measuring how connected two things are.</em></p><h3>Step 8: Spot the Odd Ones (Outlier Detection)</h3><p>Sometimes in data, a few numbers look <strong>way different</strong> from the rest — these are called <strong>outliers</strong>.<br>Outliers might be mistakes or interesting exceptions — either way, you need to notice them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABjA7dCT0teK7MGXTLSyWQ.png" /></figure><h3>Step 9: Draw It Out (Data Visualization)</h3><p>Charts help you <strong>see</strong> what your numbers are saying and will help in better data analysing:-</p><p>Common visuals:</p><ul><li>Histogram → to see distributions</li><li>Scatter plot → to see relationships</li><li>Boxplot → to find outliers</li><li>Bar chart → to compare categories</li><li>Heatmap → to see correlations</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=727064df4117" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Powerful Search and Filter Features in Rails with Ransack]]></title>
            <link>https://amithtg.medium.com/building-powerful-search-and-filter-features-in-rails-with-ransack-fb666c83e877?source=rss-b41e5aa17cdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb666c83e877</guid>
            <dc:creator><![CDATA[Amithtg ]]></dc:creator>
            <pubDate>Sat, 24 May 2025 15:19:15 GMT</pubDate>
            <atom:updated>2025-05-24T15:19:15.973Z</atom:updated>
            <content:encoded><![CDATA[<p>When developing a Ruby on Rails application, adding some type of search function is often necessary, but ensuring the search is user friendly is necessary too. Enter the ransack gem. In this post, we will show you how to set up searchable, human-readable filters with Ransack in a Book-Author-Publisher application.</p><p><strong>Ransack is a Rails engine</strong> that allows you to implement search forms and sorting links for your models with little code. <br>It provides some features such as:</p><ul><li><strong><em>Flexible search</em></strong></li><li><strong><em>Queries on associations</em></strong></li><li><strong><em>Enumeration support</em></strong></li><li><strong><em>The ability to sort with </em></strong><strong><em>sort_link</em></strong></li><li><strong><em>Friendly form helpers that are human-readable</em></strong></li></ul><blockquote><strong>What’s New in Rails 6.1+ and Rails 7+ ?</strong></blockquote><blockquote>Rails 6.1+ and Rails 7+ What Has Changed Rails versions before 6.1 allowed Ransack to search all the attributes by default. With Rails 6.1+ and in Rails 7+, you must whitelist the attributes and associations that you want Ransack to search or sort.</blockquote><blockquote><strong><em>Install Ransack</em> <em>:-</em></strong><br>Add Ransack to your Gemfile:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*Je55bvL72_57g9v2U2QAZA.png" /></figure><blockquote>Then Run: <strong>bundle install</strong></blockquote><blockquote><strong>Attributes <em>:-</em><br></strong>You must explicitly define which attributes are allowed for Ransack to query:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OuZDHgvw7-kf8Zk2cJHGBQ.png" /></figure><p><em>This enables Ransack to utilize query keys.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8c7xMTuIFdUopFYppArA4w.png" /></figure><p><em>All other attributes not mentioned here will be prevented from being searched.</em></p><blockquote><strong>Associations <em>:-</em><br></strong>You can also define which model associations can be searched through:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQjeOueccgwdhX1_uJcFDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQJjL5ARS11jkiCzqMXtDA.png" /></figure><p><em>This allows Ransack to join associated models and perform deep queries.</em></p><blockquote><strong>Search Types <em>:-</em><br></strong>Search types are suffixes that you attach to search forms in order for Ransack to determine the type of filtering you are looking for.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEnQS9NSwtGIuL3aOJKgxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*evy4O9crg2LKtsdx5RqnqA.png" /></figure><blockquote><strong>Sort Links <em>:-</em><br></strong>sort_link is used to create <strong>clickable headers</strong> for your table columns so users can sort by that field.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*Cww-nvuFqWv3jUB9W1rj6w.png" /></figure><p><strong>Demo Setup (Books, Authors, Publishers)<br></strong>app/models/book.rb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qB1MrMzgFpHBY_5Jeu-IWg.png" /></figure><p>app/models/author.rb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*leXlKCzHxYKhf06vNpDinA.png" /></figure><p>app/models/publisher.rb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*UK9FeIOy3Q3dvR0AHduUlQ.png" /></figure><p>app/controllers/books_controller.rb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sa8g6cQ7ZDU3EejxBs8byg.png" /></figure><p>app/views/books/index.html.erb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p8D459DRD0R5qZ8kqM_S0A.png" /></figure><p>app/views/books/_books_list.html.erb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tX1BP3nMdkBzM_rVqa1Sw.png" /></figure><p><strong>Final Output:-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cnrz4s6n7Dnpyj3lZLr9lg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FjnDEb0IB7G64EorjJZHqw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb666c83e877" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>