API v1 order_articles endpoints
This commit is contained in:
parent
127ae83f04
commit
ed9192c47f
14 changed files with 323 additions and 4 deletions
9
app/serializers/article_serializer.rb
Normal file
9
app/serializers/article_serializer.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
class ArticleSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name
|
||||
attributes :supplier_id, :supplier_name
|
||||
attributes :unit, :unit_quantity, :note, :manufacturer, :origin, :article_category_id
|
||||
|
||||
def supplier_name
|
||||
object.supplier.try(:name)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue