This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # sum of the even-valued terms in the Fibonacci sequence (starting with 1 and 2) whose values do not exceed four million | |
| result = 0 | |
| current_number, next_number = 1 , 2 | |
| while current_number < 4000000 | |
| if current_number % 2 == 0 | |
| result += current_number | |
| end | |
| current_number, next_number = next_number, current_number + next_number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |