RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Webinar Recording: Refactoring Rails Applications with RubyMine

Last week, together with JetBrains, we presented a webinar on using RubyMine with Rails apps in the context of refactoring. The recording is now available.

When you go to the YouTube page of the video, you will find the links to each section of the webinar, like:

Slides: Typical Rails problems

01:26 - Rails is great at the beginning
02:09 - 2.months.later, first problems
03:59 - 6.months later, hidden dependencies, security bugs, rails upgrades
06:01 - 2.years.later, new team members, huge classes
07:50 - New guidelines
13:30 - Why is extracting a service object a good starting point in refactoring?
14:08 - DDD service objects vs Rails service objects
14:50 - Question: When is a good time to start refactoring?
17:50 - Typical controller coupling, views, @ivars, filters
21:32 - Redmine project explanation, codebase overview

RubyMine session - extracting a service object

24:54 - Question: How to build a refactor strategy when your test coverage is not good enough?
27:22 - RubyMine overview, structure view, scratch file, listing concerns, ‘create’ action
28:45 - Running a subset of tests
30:10 - Grouping concerns - controller takes care of all http-related concerns
30:51 - An example test which is good enough for refactoring
32:10 - Start of the refactoring - code changes
32:30 - Run tests with the coverage tool, explaining the limitations of line coverage tools
33:30 - Live template example - service object template, CreateTimeEntry class
34:49 - What’s the good name for the service object method name? execute or call
36:49 - Tests pass after moving some code to the new class
38:40 - Handling the ‘return’ statement with the Proc
45:56 - Extracting the respond_create_success, respond_create_failure methods
47:39 - When to stop refactoring?
49:56 - Question: When to introduce service objects, when to follow The Rails Way?
51:44 - Question: Which params to pass to the constructor of the service object and which to the method?
53:50 - Extracting the service object to the new file

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in