rails Cross domain session sharing in Rails - Part 2 We have multiple micro services at Memory.ai which talk to each other and share data. As we are extracting more and more micro services, we were facing the problem of adding authentication
rails Cross domain session sharing in Rails - Part 1 We have multiple micro services at Memory.ai which talk to each other and share data. As we are extracting more and more micro services, we were facing the problem of adding authentication
rails prepend_before_action in Rails Rails encourages usage of callbacks in controllers to execute common pieces of code before or after an action. A very simple example of this is calling the authenticate_user! method from Devise before
rails Mastering Packs in Webpacker In the previous article, we saw what Webpacker is and how Rails 6 has integrated it. In this article, we will understand how to use the packs.A new Rails 6 app creates
rubocop Making friends with RuboCop At Memory.ai, we started using RuboCop heavily. This is a story of how we integrated RuboCop into our existing app. This is not an introductory post to RuboCop. Check out what RuboCop
rails DNS rebinding attacks protection in Rails 6 It is common practice to run a Rails app using a custom domain locally. app.lvh.me is very common. We also use ngrok.io sometimes to interact with third party services. If
rails Understanding Webpacker in Rails 6 Starting with Rails 6, Webpacker is the default JavaScript compiler. It means that all the JavaScript code will be handled by Webpacker instead of the old assets pipeline aka Sprockets. Webpacker is different
rails New framework defaults in Rails 6 Rails 6 is released. This post is part of the Road to Rails 6 series which will prepare you for Rails 6.Every time a new major Rails version is released, there are
rails Advanced multi-db techniques in Rails 6 Rails 6 is just around the corner. The release candidate two was recently released. This post is part of the Road to Rails 6 series which will prepare you for Rails 6.Check
rails Setting up Rails 6 app with multiple databases on Heroku Rails 6 is just around the corner. The release candidate two was recently released. This post is part of the Road to Rails 6 series which will prepare you for Rails 6.When
rails How to (not) use unscoped in Rails Active Record provides unscoped to remove all the scopes added to a model previously.class Article default_scope { where(published: true) } end Article.all # SELECT * FROM articles WHERE published = true Article.unscoped # SELECT
rails Installing capybara-webkit gem on Ubuntu 16.04 I was not able to install capybara-webkit gem on Ubuntu 16.04. I tried to follow the instructions mentioned in the gem wiki to solve this problem.sudo apt-get update sudo apt-get install
emacs Creating pull requests from emacs Learn how to create pull requests in Github from emacs with the help of magit
ruby b - a hidden method from Ruby string class After my last post on how Ruby initializes objects, Sagar shared with me following code.class Abc attr_accessor :a, :b def self.new(a, b) @a = a @b = b end end o
ruby Understanding how Ruby initializes objects Deep buried in Rails source code, there is a code snippet:class DeprecationProxy def self.new(*args, &block) object = args.first return object unless object super end ... end It was added 9
community Insights from the SICP meetup We organized a SICP reading meetup on 11th May in Pune. Our inspiration was similar meetup from our friends Siddharth and Soham in Mumbai. This was the second such meetup that we did.
postgresql Fix weird PostgreSQL error after updating Postgres.app Recently I updated Postgres.app and after that I started getting a weird error while running Active Record tests locally using PostgreSQL adapter./Users/prathamesh/Projects/sources/rails/activerecord/lib/active_record/connection_
ruby Installing eventmachine gem on El Capitan I keep forgetting how to install eventmachine on El Capitan Mac OS X.So adding this post to lookup when required.$ gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/
emacs Log notes while stopping Org timer Recently I started tracking the time I spent on various coding activities using Org mode. C-c C-x C-i is used to start the timer and C-c C-x C-o is used to stop the
emacs Configuring web-mode with JSX I use web-mode for editing different templates like html, .erb, .js.jsx. It understands React’s JSX tags also which is great because I don’t need a separate mode just for JSX.
ruby kgio, raindrops, unicorn and Ruby 2.2.0-preview1 I was trying to upgrade Codetriage to use Ruby 2.2.0-preview, the latest Ruby version. The project is hosted on Heroku. So to upgrade I changed Ruby version in Gemfile:# Gemfile ruby
ruby After effects of updating openssl on Mac OS X Today, my openssl library on Mac OS X Mavericks got updated. After the update, when i tried doing rails s on one of the rails apps, it gave following error:/Users/prathamesh/.rbenv/
ruby Setting up Ruby development setup with rbenv I wanted to setup ruby source code on my machine. The source on Github has detailed instructions on how to do the setup.git clone github.com/ruby/ruby cd ruby autoconf ./configure
ruby Weirdness of Bigdecimal.new Recently i was bitten by this weirdness of BigDecimal in Ruby.BigDecimal.new excepts initial value and number of significant digits. In one of my app, BigDecimal.new was called with string initial