Created
July 5, 2014 15:35
-
-
Save y00rb/a8f61d3ec27a097b2b16 to your computer and use it in GitHub Desktop.
no inherite model, it is basic class
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
class PlainModel | |
include ActiveModel::Model | |
include ActiveSupport::Callbacks | |
include ActiveModel::Validations::Callbacks | |
define_callbacks :save | |
def save | |
if valid? | |
run_callbacks :save do | |
true | |
end | |
else | |
false | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment