Skip to content

Commit

Permalink
Adding city to stores
Browse files Browse the repository at this point in the history
  • Loading branch information
sofianegargouri committed Feb 9, 2025
1 parent 8af302d commit e67542c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/policies/store_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def permitted_attributes_for_create
email_address
country_id
color
city
key
]
end
Expand All @@ -42,6 +43,7 @@ def permitted_attributes_for_update
website_url
email_address
color
city
]
end

Expand Down
1 change: 1 addition & 0 deletions app/serializers/store_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class StoreSerializer < ActiveModel::Serializer
attributes :id,
:name,
:key,
:city,
:address1,
:address2,
:zipcode,
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20250209135124_adding_infos_to_stores.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def change
t.string :phone_number
t.string :email_address
t.string :color
t.string :city
end
end
end
1 change: 1 addition & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
t.string "phone_number"
t.string "email_address"
t.string "color"
t.string "city"
t.index ["country_id"], name: "index_stores_on_country_id"
t.index ["deleted_at"], name: "index_stores_on_deleted_at"
end
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/v2/stores_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
parameter :address1, "Store's address (line 1)"
parameter :address2, "Store's address (line 2)"
parameter :zipcode, "Store's zipcode"
parameter :city, "Store's color"
parameter :phone_number, "Store's phone number"
parameter :website_url, "Store's website url"
parameter :email_address, "Store's email address"
Expand Down Expand Up @@ -69,6 +70,7 @@
parameter :address1, "Store's address (line 1)"
parameter :address2, "Store's address (line 2)"
parameter :zipcode, "Store's zipcode"
parameter :city, "Store's city"
parameter :phone_number, "Store's phone number"
parameter :website_url, "Store's website url"
parameter :email_address, "Store's email address"
Expand Down

0 comments on commit e67542c

Please sign in to comment.