quandl_client 2.7.8 → 2.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/UPGRADE.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.7.9
2
+
3
+ * QUGC-164 also search by code
4
+ * QUGC-164 find by id or source_code/code, or build
5
+ * QUGC-164 attributes slice needs to ensure that keys are symbols
6
+
7
+
8
+
1
9
  ## 2.7.8
2
10
 
3
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.7.8
1
+ 2.7.9
@@ -11,10 +11,16 @@ class Quandl::Client::Superset < Quandl::Client::Base
11
11
  validate :column_codes_should_be_valid!
12
12
 
13
13
  def self.find_or_build( attributes={} )
14
- record = self.find(attributes[:id]) if attributes[:id].present?
15
- record = self.where( attributes.slice(:code, :source_code).merge( owner: 'myself' ) ).first unless record.try(:exists?)
14
+ attrs = attributes.symbolize_keys!
15
+ # by id
16
+ record = self.find(attrs[:id]) if attrs[:id].present?
17
+ # by source_code/code
18
+ record = self.find(File.join(attrs[:source_code], attrs[:code])) if !record.try(:exists?) && attrs[:source_code].present? && attrs[:code].present?
19
+ # by code
20
+ record = self.find(attrs[:code]) if !record.try(:exists?) && attrs[:code].present?
21
+ # build
16
22
  record = self.new unless record.try(:exists?)
17
- record.assign_attributes(attributes)
23
+ record.assign_attributes(attrs)
18
24
  record
19
25
  end
20
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.8
4
+ version: 2.7.9
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: 2014-04-25 00:00:00.000000000 Z
12
+ date: 2014-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: quandl_data
@@ -296,7 +296,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
296
  version: '0'
297
297
  segments:
298
298
  - 0
299
- hash: 245737083235874594
299
+ hash: -2036948263247653299
300
300
  required_rubygems_version: !ruby/object:Gem::Requirement
301
301
  none: false
302
302
  requirements:
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  version: '0'
306
306
  segments:
307
307
  - 0
308
- hash: 245737083235874594
308
+ hash: -2036948263247653299
309
309
  requirements: []
310
310
  rubyforge_project:
311
311
  rubygems_version: 1.8.23