Tag Archives: rails 5

Use “rails” instead of “rake” in Rails 5

A pain point for new Rails developers is learning which command goes after the “rails” keyword and which go after the “rake” keyword. In Rails 5, just use “rails”. The source of this issue in previous versions of Rails is the fact that some commands make sense to be rails commands, such as rails server, […]

Posted in Technology | Also tagged , | Leave a comment

Rails 5 adds method source

Here is an example of the Rails team making it easier for developers to access much needed tools: you can now inspect the source code for a method right from irb. Say you had the following source code: In irb you can do: This functionality is from a gem called method_source, which is one component […]

Posted in Technology | Also tagged | Leave a comment

Rails 5 adds ActiveRecord or

Here’s a long awaited feature that is added in Rails 5: ActiveRecord or. Previously you had to use ARel or resort to a SQL snippet: Now you can do: In other words: you first build a relation, then use the or method on it passing in as an argument another relation. These two relations must […]

Posted in Technology | Also tagged , | Leave a comment