Last active
September 9, 2015 20:31
-
-
Save heri/aa70f6ee79b893897513 to your computer and use it in GitHub Desktop.
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
# Saves a comment by current user to an event | |
def save_event_comment | |
model._created_at = Time.now | |
model.save!.then do | |
flash._notices << "Thanks for adding a comment" | |
new_event_comment | |
end.fail do |err| | |
flash._notices << err.to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment