README.md in rest_model-0.2.0 vs README.md in rest_model-0.2.1
- old
+ new
@@ -21,14 +21,14 @@
class Account < RestModel
property :number
property :balance, type: Float
property :type, values: {gold: '01', platinum: '02'}
-
+
embeds_one :electronic_card
embeds_many :transactions
-
+
belongs_to :customer
has_one :manager
has_many :tickets
end
@@ -153,11 +153,11 @@
property :amount, type: Float
end
class Order < RestModel
id
- embeds_many :items, class: OrderItems
+ embeds_many :items, class_name: 'order_items'
end
{
id: '739819813719387',
items: [
@@ -203,33 +203,9 @@
href: 'http://app/api/users/19837139879/achievements'
},
{
rel: 'guilda',
href: 'http://app/api/users/19837139879/guilda
- }
- ]
- }
-
-### embedding relations
-
-If you want your api to handle `http://app/api/users/19371897318937?include[]=avatar&include[]=guilda`
-
- user = User.from_source(input, include: [avatar_input, guilda_input]).first
-
- {
- id: '19837139879',
- login: 'jsmith180',
- avatar: {
- name: 'K1ll3r',
- specie: 'WTF'
- },
- guilda: {
- name: 'K1ll3rs'
- },
- link: [
- {
- rel: 'achievements',
- href: 'http://app/api/users/19837139879/achievements'
}
]
}
### [See more examples here](https://github.com/rodrigues/rest_client/tree/master/examples).