fat-code-refactoring-techniques
fat-code-refactoring-techniques copied to clipboard
Code samples for RailsConf 2014 on Fat Code Refactoring
Bumps [rack](https://github.com/rack/rack) from 1.5.2 to 1.5.5. Changelog Sourced from rack's changelog. Changelog All notable changes to this project will be documented in this file. For info on how to format...
Bumps [rake](https://github.com/ruby/rake) from 10.3.1 to 12.3.3. Changelog Sourced from rake's changelog. === 12.3.3 ==== Bug fixes Use the application's name in error message if a task is not found. Pull...
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.6.1 to 1.6.8.1. Changelog Sourced from nokogiri's changelog. 1.6.8.1 / 2016-10-03 Dependencies Removes required dependency on the pkg-config gem. This dependency was introduced in v1.6.8 and, because...
Example of how to split up a large controller. [](https://reviewable.io/reviews/justin808/fat-code-refactoring-techniques/13)
### Clean up complicated controller method by moving logic to models - Create ProfanityChecker model to encapsulate logic of checking for profanity. - Moved business logic from micropost controller to...
# Single Purpose Controller This is a preferable alternative to pull request https://github.com/justin808/fat-code-refactoring-techniques/pull/6, which uses a Service Object pattern. Objectives: - Splitting the `MicropostController` into the `MicropostCreateController` to so that...
# A Name for a PORO - Some Object for Complicated controller setup for a view - Terminology is controversial in the context of prior literature. - Trying to describe...
# Service Objects This code demonstrates moving complex controller code into a class that manages model interactions, aka a `Service Object`. The controller calls the Service Object and it returns...
# Draper Decorator - Easy to use formula for introducing decorators in your application. - Simple to include like Concerns. - Widely used in the Rails community. - Works for...
RailsConf 2014 Talk, Tuesday, 2:30, Ballroom 4, [Concerns, Decorators, Presenters, Service Objects, Helpers, Help Me Decide!](http://www.railsconf.com/program#prop_445) # Use Rails rather than Service Objects Refactored fat, complicated, full-of-business MicropostController create action...