<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>rails on Ivan Tkalin</title>
    <link>https://www.tkalin.com/tags/rails/</link>
    <description>Recent content in rails on Ivan Tkalin</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>itkalin@gmail.com (Ivan Tkalin)</managingEditor>
    <webMaster>itkalin@gmail.com (Ivan Tkalin)</webMaster>
    <copyright>© Ivan Tkalin</copyright>
    <lastBuildDate>Sun, 24 Apr 2016 11:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://www.tkalin.com/tags/rails/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Rails bug with polymorphic associations</title>
      <link>https://www.tkalin.com/blog_posts/rails-bug-with-polymorphic-associations/</link>
      <pubDate>Sun, 24 Apr 2016 11:00:00 +0000</pubDate>
      <author>itkalin@gmail.com (Ivan Tkalin)</author>
      <guid>https://www.tkalin.com/blog_posts/rails-bug-with-polymorphic-associations/</guid>
      <description>In general, I don&amp;rsquo;t like using polymorphic associations, because of inability to have a database-level integrity control and trickier eager loading. However, sometimes they look like a natural choice for certain cases in Ruby on Rails applications.
Recently, I faced a problem, which turned out to be a bug in how Rails handles negations with polymorphic associations. It took me some time to figure out what exactly was wrong, so I decided to share my experience here for future reference (mostly for myself).</description>
    </item>
    
    <item>
      <title>Rails 4: Disable assets caching for development/test environments</title>
      <link>https://www.tkalin.com/blog_posts/rails-4-disable-assets-caching-for-development-test-environments/</link>
      <pubDate>Thu, 27 Feb 2014 09:00:00 +0000</pubDate>
      <author>itkalin@gmail.com (Ivan Tkalin)</author>
      <guid>https://www.tkalin.com/blog_posts/rails-4-disable-assets-caching-for-development-test-environments/</guid>
      <description>Ruby on Rails by default caches pre-compiled assets (sass, coffeescripts) to tmp/cache/assets directory in development and test environments. It makes page loading in development and running test faster (when assets are already precompiled), but may cause some weird bugs.
For example, when I was upgrading my Rails 3.2 application to Rails 4, I noticed that there are deprecation messages on CI server, but not on my local machine. I started investigating it and found, that these deprecation messages come from SASS file in one of my gems (it was twitter bootstrap 2.</description>
    </item>
    
    <item>
      <title>Quick PostgreSQL server optimization for development (or integration server)</title>
      <link>https://www.tkalin.com/blog_posts/quick-postgresql-server-optimization-for-development-or-integration-server/</link>
      <pubDate>Sun, 10 Nov 2013 20:00:00 +0000</pubDate>
      <author>itkalin@gmail.com (Ivan Tkalin)</author>
      <guid>https://www.tkalin.com/blog_posts/quick-postgresql-server-optimization-for-development-or-integration-server/</guid>
      <description>TL;DR I&amp;rsquo;ve made RSpec test suite for my Ruby on Rails application 18% faster by following a Non-durable PostgreSQL configuration guide.
Intro When I&amp;rsquo;m developing (usually Ruby on Rails) applications using PostgreSQL database server for persistence, I don&amp;rsquo;t need high durability of my development database (or integration server). What I care the most is it&amp;rsquo;s speed. I realize, however, that database server, probably, is not the bottle neck of the typical application test suite.</description>
    </item>
    
    <item>
      <title>Protecting staging/testing site area</title>
      <link>https://www.tkalin.com/blog_posts/protecting-staging-testing-site-area/</link>
      <pubDate>Mon, 30 Jul 2012 21:30:00 +0000</pubDate>
      <author>itkalin@gmail.com (Ivan Tkalin)</author>
      <guid>https://www.tkalin.com/blog_posts/protecting-staging-testing-site-area/</guid>
      <description>It seems, that the easiest way to protect staging/testing version of the (rails) application from search engines and undesired users is using HTTP Basic Authentication. Configuring it for nginx is very easy and well documented.
First, enable HTTP Basic Authentication and specify passwords file location. To do this, add these lines to the site&amp;rsquo;s server config:
auth_basic &amp;quot;Testing Zone&amp;quot;; auth_basic_user_file /var/www/my_app/current/shared/config/.htpasswd;  Passwords file, specified in auth_basic_user_file directive, should store users and encrypted passwords in the following format:</description>
    </item>
    
    <item>
      <title>Multiple file upload with Rails 3.2, paperclip, html5 and no javascript</title>
      <link>https://www.tkalin.com/blog_posts/multiple-file-upload-with-rails-3-2-paperclip-html5-and-no-javascript/</link>
      <pubDate>Fri, 25 May 2012 19:00:00 +0000</pubDate>
      <author>itkalin@gmail.com (Ivan Tkalin)</author>
      <guid>https://www.tkalin.com/blog_posts/multiple-file-upload-with-rails-3-2-paperclip-html5-and-no-javascript/</guid>
      <description>Today, I was looking for a simple multiple file upload solution for Ruby on Rails 3.2 with paperclip 3.0.4 and found several jQuery and Flash solutions, like Uploadify or jQuery-File-Upload, buy they seemed to be too heavy and complicated for my case. I didn&amp;rsquo;t need asynchronous upload and other features they provide, I only needed really simple (ideally pure html) solution to save several images for my Item model with regular form submit, but with possibility to select all images at once (in one input field).</description>
    </item>
    
    <item>
      <title>Testing authorization using RSpec parametrized shared examples </title>
      <link>https://www.tkalin.com/blog_posts/testing-authorization-using-rspec-parametrized-shared-examples/</link>
      <pubDate>Wed, 23 May 2012 15:00:00 +0000</pubDate>
      <author>itkalin@gmail.com (Ivan Tkalin)</author>
      <guid>https://www.tkalin.com/blog_posts/testing-authorization-using-rspec-parametrized-shared-examples/</guid>
      <description>I have a rails app, that uses Devise for authentication and CanCan for authorization. There is a group of controllers in my application, that should be accessible by administrators only. I was thinking about a DRY way to test these resources and their accessibility by administrators only (using request specs with RSpec and Capybara).
The idea is to have shared examples, which try to visit resource url as unauthenicated user, authenicated non-privileged user and administrator, and check if desired resource was loaded or not.</description>
    </item>
    
  </channel>
</rss>
