Created
September 3, 2014 15:33
-
-
Save bezelga/ad2833c64e0678e34f1a to your computer and use it in GitHub Desktop.
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 TasksRepository::ActiveRecord | |
def persist(task_entity) | |
task = Task.create({ title: task_entity.title }) | |
serialize task | |
end | |
def count | |
Task.count | |
end | |
private | |
def serialize(task) | |
Tod::Entities::Task.new(title: task.title).tap do |task_entity| | |
task_entity.id = task.id | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment