kounta_rest 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kounta/company.rb +2 -0
- data/lib/kounta/rest/client.rb +2 -4
- data/lib/kounta/version.rb +1 -1
- metadata +2 -2
data/lib/kounta/company.rb
CHANGED
@@ -23,6 +23,7 @@ module Kounta
|
|
23
23
|
has_one :site, Kounta::Site, {:company_id => :id}, lambda { |klass, item_id| {companies: klass.id, sites: item_id} }
|
24
24
|
has_one :price_list, Kounta::PriceList, {:company_id => :id}, lambda { |klass, item_id| {companies: klass.id, price_lists: item_id} }
|
25
25
|
has_one :tax, Kounta::Tax, {:company_id => :id}, lambda { |klass, item_id| {companies: klass.id, taxes: item_id} }
|
26
|
+
has_one :order, Kounta::Order, {:company_id => :id}, lambda { |klass, item_id| {companies: klass.id, orders: item_id} }
|
26
27
|
|
27
28
|
has_many :products, Kounta::Product, {:company_id => :id}, lambda { |klass| {companies: klass.id, products: nil} }
|
28
29
|
has_many :categories, Kounta::Category, {:company_id => :id}, lambda { |klass| {companies: klass.id, categories: nil} }
|
@@ -31,6 +32,7 @@ module Kounta
|
|
31
32
|
has_many :sites, Kounta::Site, {:company_id => :id}, lambda { |klass| {companies: klass.id, sites: nil} }
|
32
33
|
has_many :price_lists, Kounta::PriceList, {:company_id => :id}, lambda { |klass| {companies: klass.id, price_lists: nil} }
|
33
34
|
has_many :taxes, Kounta::Tax, {:company_id => :id}, lambda { |klass| {companies: klass.id, taxes: nil} }
|
35
|
+
has_many :orders, Kounta::Order, {:company_id => :id}, lambda { |klass| {companies: klass.id, orders: nil} }
|
34
36
|
|
35
37
|
def initialize(hash={})
|
36
38
|
if hash.empty?
|
data/lib/kounta/rest/client.rb
CHANGED
@@ -37,10 +37,8 @@ module Kounta
|
|
37
37
|
raise Kounta::Errors::APIError.new(ex.message)
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
response.parsed
|
43
|
-
end
|
40
|
+
log("Response: #{response.parsed}")
|
41
|
+
response.parsed
|
44
42
|
end
|
45
43
|
|
46
44
|
def objects_from_response(klass, request_method, url_hash, options={})
|
data/lib/kounta/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kounta_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|