Last active
November 26, 2017 03:38
-
-
Save Kevin-Kawai/2cf52e4aa1621e786e4866decc329eeb to your computer and use it in GitHub Desktop.
reading code?
This file contains 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
class ApprovalService | |
def initialize(input_form) | |
@input_form = input_form | |
end | |
def approve | |
DataStuff.new(input_form) | |
DataStuff.save! | |
end | |
end |
This file contains 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
class PagesController < ApplicationController | |
def index | |
@input_form = InputForm.new | |
end | |
def approve | |
@input_form = InputForm.new | |
ApprovalService.new(@input_form).approve! | |
end | |
end |
This file contains 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
class InputForm | |
after_initialize do | |
self.current_date = Date.current | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment