Post-Deployment script on Elastic Beanstalk: Restart Delayed Job
Jan 8, 2015 - Daniel Viklund
UPDATE 2021!
#delayed-job #AWS #Elastic Beanstalk #Ruby on Rails
Jan 8, 2015 - Daniel Viklund
#delayed-job #AWS #Elastic Beanstalk #Ruby on Rails
Dec 29, 2019 - Daniel Viklund
When the need arise to SSH into your EB instance and execute a command in your app, you might run into issues. I describe in an earlier post how to trigger a restart of DelayedJob after each deployment. In that particular case, one issue was that the command was not running under the correct ruby installation. Turns out that we can make use of EB’s own support scripts to help us out.
Feb 8, 2020 - Daniel Viklund
Elastic Beanstalk is great! It is very easy to get a Rails app up and running on AWS quickly. Perfect for an app developer that prefers not to deal directly with sysops but still wants to deploy to and leverage the services on AWS.
Ruby on Rails Explained
Jul 20, 2018 - Daniel Viklund
When writing controllers in Ruby on rails, using before_action
(used to be called before_filter
in earlier versions) is your bread-and-butter for structuring your business logic in a useful way. It’s what you want to use to “prepare” the data necessary before the action executes.
Ruby on Rails Explained
Jul 20, 2020 - Daniel Viklund
I have previously written a post about Find or create by and its usages in Rails 3 but Rails have gotten several version updated since then and some of the things I mentioned have even been deprecated at this time, so I wanted to revisit this very useful method again.
Oct 20, 2012 - Daniel Viklund
Elastic Beanstalk on Amazon Linux 2
Aug 5, 2021 - Daniel Viklund
I have written about this or similar topics before in both Post-Deployment script on Elastic Beanstalk: Restart Delayed Job as well as Convenient way to run app commands in Elastic Beanstalk.
#Elastic Beanstalk #Amazon Linux 2 #Ruby on Rails
Rails 7
Mar 2, 2021 - Daniel Viklund
It looks like a new syntax for declaring enums in your models has been introduced. Instead of passing the name and values as a key/value pair, it can now be passed as two separate arguments instead. Not a big change in itself but what this enables is in my opinion a more intuitive way to pass additional options.
Rails 7
Mar 24, 2021 - Daniel Viklund
Rails 7 adds Enumerable#maximum and Enumerable#minimum methods to easily calculate the maximum or minimum from extracted elements. These methods have existed in ActiveRecord for some time now and is useful when you have a collection of records.
Rails 7
Apr 19, 2021 - Daniel Viklund
It is quite common to execute multiple queries in a controller action. Just as an example, there might be a dashboard that displays data from multiple models or scopes.
Ruby on Rails Explained
Oct 22, 2020 - Daniel Viklund
Scoping in Ruby on Rails allows us to define frequently used queries which can be invoked as method calls on either association objects, relations or models. You can reference the standard query methods like where
, joins
and includes
. The requirements of defined scopes is that it must return either an instance of ActiveRecord::Relation
or nil
. This allows us to chain multiple scopes together for highly flexible query construction.
Ruby on Rails Explained
Dec 15, 2018 - Daniel Viklund
ActiveRecord
has a lot of callbacks but probably one of the most frequently used ones is before_save
. There are a few other ones that are very similar like before_create
and before_update
, but they are just more narrowly scoped callbacks hat otherwise does the same thing.
Dec 27, 2022 - Daniel Viklund
Ruby on Rails is a popular web application framework that has been used by developers for over a decade. It has a reputation for being easy to learn and use, and for providing developers with a lot of tools and features to build robust web applications.
Ruby on Rails Explained
May 31, 2023 - Daniel Viklund
In the Model-View-Controller (MVC) architecture, the Model is responsible for representing the data and the business logic of an application. In Ruby on Rails, the Model is implemented using the ActiveRecord pattern, which is a powerful and easy-to-use ORM (Object-Relational Mapping) tool. In this article, we will explore the Model part of MVC in Rails and provide code examples to illustrate its usage.
Ruby on Rails Explained
Aug 23, 2022 - Daniel Viklund
When developing a web application with Ruby on Rails, it is common to create associations between different models. Among the most important associations in Rails is the belongs_to
method, which establishes a one-to-many relationship between two models.