Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 0e8f01d

Browse files
committed
Added field to persist image of pet
1 parent 25e7c84 commit 0e8f01d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Lotus::Model.migration do
2+
change do
3+
add_column :pets, :image_id, String
4+
end
5+
end

lib/config/mapping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
attribute :id, Integer
3636
attribute :user_id, Integer
3737
attribute :name, String
38+
attribute :image_id, String
3839
attribute :created_at, DateTime
3940
attribute :updated_at, DateTime
4041
end

lib/drpet/entities/pet.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class Pet
44

55
attribute :name, type: String, presence: true
66
attribute :user_id, type: Integer, presence: true
7+
attribute :image, type: String # TODO Remove this useless field );
8+
attribute :image_id, type: String
79
attribute :created_at, type: DateTime
810
attribute :updated_at, type: DateTime
911
end

0 commit comments

Comments
 (0)