daengine 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3e1440a98b1842806fa635bf5512365efcecf81
4
- data.tar.gz: 463288d1e1d0990bab61a73a4d4914398d8f6d06
3
+ metadata.gz: 1307c12bc6d6907c72f5985d9519bca1e532b5c7
4
+ data.tar.gz: f4b9461b14b518793d2958deebe457d3ae39a4e5
5
5
  SHA512:
6
- metadata.gz: 86f3e5ff8a2898494b43b6a0c524b9dd4700e92bdb71cea7d05d568202eee23ec260a9df005a02e9b42df9f69824cafd1ce1a874ef508a91a3ef34dc49a6f0ce
7
- data.tar.gz: b01c160be17a73247676ef76b56909cdd7f5d4b3177b3f6a57d322231c8bbcb6cb6432e59c3f6aedf370468f39992d03c48fbc47f34b3ca2c2df2646396d4648
6
+ metadata.gz: 88cb9262ca2120859e79815145dc52e10dc84a302d2787df20716409cf66e2629c909d7975b9077a9ad53b5f54ef695b5c1daf875f04fa3075af4ef66e6a52f9
7
+ data.tar.gz: c916597be65b4a725b0a11c2c546c28272ed2cd842795ee4db9c6a20b8c2c59f6784acccf88c2a7e7f8a09d53d2c02f566dee86edbc6afa818704115b0b894ea
@@ -28,8 +28,13 @@ class DigitalAssetsController < ApplicationController
28
28
  def update
29
29
  da_passed = params[:digital_asset]
30
30
  da = DigitalAsset.find_or_initialize_by(digital_asset_id: da_passed[:digital_asset_id])
31
+ creating = da.new?
31
32
  da.update_attributes! da_passed
32
- head :ok
33
+ if(creating)
34
+ head :created, location: digital_asset_path(da)
35
+ else
36
+ head :ok
37
+ end
33
38
  end
34
39
 
35
40
  alias :create :update
@@ -5,12 +5,12 @@ class DigitalAsset
5
5
  include Mongoid::Timestamps
6
6
 
7
7
  field :title, type: String
8
- field :changed_at, type: Time
8
+ field :changed_at, type: DateTime
9
9
  field :audiences, type: Array, default: []
10
10
  field :sami_code, type: String
11
- field :published_at, type: Time
12
- field :unpublished_at, type: Time
13
- field :expires_at, type: Time
11
+ field :published_at, type: DateTime
12
+ field :unpublished_at, type: DateTime
13
+ field :expires_at, type: DateTime
14
14
  field :guid, type: String
15
15
  field :business_owner, type: String
16
16
  field :summary, type: String
@@ -21,7 +21,7 @@ class DigitalAsset
21
21
  # refactor version:
22
22
  field :path, type: String
23
23
  field :legacy_path, type: String
24
- field :doc_changed_at, type: Time
24
+ field :doc_changed_at, type: DateTime
25
25
  field :content_type, type: String
26
26
  field :pages, type: Integer, default: 1
27
27
  field :size, type: String
@@ -93,6 +93,7 @@ class TeamsiteDigitalAssetShim
93
93
  def update_attributes!(atts = {})
94
94
  # deconvert metadata from old to new
95
95
  self.attributes = atts
96
+ atts.delete('documents_attributes')
96
97
  da = DigitalAsset.new(atts)
97
98
  doc = first_non_finra
98
99
  da.path = doc.try(:path)
@@ -106,7 +107,10 @@ class TeamsiteDigitalAssetShim
106
107
  da.keywords = doc.keywords
107
108
  da.author = doc.author
108
109
  da.digital_asset_id = guid
109
- da.documents = nil
110
+ # try to find fund-codes
111
+ # codes = product_ids.try(:collect) do |id|
112
+ # TaxonomyTerm.term_id_is(id).try(:first).try(:term_type).try([], 'FUND_CODE')
113
+ # end.try(:compact)
110
114
  # save the new metadata format
111
115
  da.save!
112
116
  end
@@ -16,9 +16,9 @@ class DigitalAssetLookupService
16
16
  # found_asset
17
17
  # end
18
18
 
19
- # def self.fund_code_from_id(taxonomy_id)
20
- # TaxonomyTerm.term_id_is(taxonomy_id).try(:term_type).try([], 'FUND_CODE')
21
- # end
19
+ def self.fund_code_from_id(taxonomy_id)
20
+ TaxonomyTerm.term_id_is(taxonomy_id).try(:term_type).try([], 'FUND_CODE')
21
+ end
22
22
 
23
23
  # def self.term_id_from_fund_code(code)
24
24
  # term = TaxonomyTerm.fund_code_is(code)
@@ -1,3 +1,3 @@
1
1
  module Daengine
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
@@ -8800,3 +8800,103 @@ Completed 200 OK in 4.0ms (Views: 2.0ms)
8800
8800
  Processing by DigitalAssetsController#search as HTML
8801
8801
  Parameters: {"digital_asset_id"=>"blargh-blargh-blargh", "title"=>"Doc Title"}
8802
8802
  Completed 200 OK in 4.0ms (Views: 3.0ms)
8803
+ Started GET "/digital_assets" for 127.0.0.1 at 2014-02-05 12:47:54 -0700
8804
+ Processing by DigitalAssetsController#index as JSON
8805
+ Completed 200 OK in 26.0ms (Views: 3.0ms)
8806
+ Started GET "/digital_assets?digital_asset_id=id-foobar-permanent-1" for 127.0.0.1 at 2014-02-05 12:47:54 -0700
8807
+ Processing by DigitalAssetsController#index as JSON
8808
+ Parameters: {"digital_asset_id"=>"id-foobar-permanent-1"}
8809
+ Completed 200 OK in 107.0ms (Views: 100.0ms)
8810
+ Started GET "/digital_assets?fund=00200" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8811
+ Processing by DigitalAssetsController#index as JSON
8812
+ Parameters: {"fund"=>"00200"}
8813
+ Completed 200 OK in 57.0ms (Views: 50.0ms)
8814
+ Started GET "/digital_assets?digital_asset_id=id-foobar-permanent-4" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8815
+ Processing by DigitalAssetsController#index as JSON
8816
+ Parameters: {"digital_asset_id"=>"id-foobar-permanent-4"}
8817
+ Completed 200 OK in 30.0ms (Views: 26.0ms)
8818
+ Started GET "/digital_assets?path=%2Fsome%2Fother%2Fpath.pdf" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8819
+ Processing by DigitalAssetsController#index as JSON
8820
+ Parameters: {"path"=>"/some/other/path.pdf"}
8821
+ Completed 200 OK in 29.0ms (Views: 25.0ms)
8822
+ Started GET "/digital_assets?digital_asset_id=id-foobar-permanent-6" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8823
+ Processing by DigitalAssetsController#index as JSON
8824
+ Parameters: {"digital_asset_id"=>"id-foobar-permanent-6"}
8825
+ Completed 200 OK in 30.0ms (Views: 26.0ms)
8826
+ Started GET "/digital_assets?published=2014-02-05+17%3A47%3A55+UTC" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8827
+ Processing by DigitalAssetsController#index as JSON
8828
+ Parameters: {"published"=>"2014-02-05 17:47:55 UTC"}
8829
+ Completed 200 OK in 60.0ms (Views: 21.0ms)
8830
+ Started GET "/digital_assets/foo-bar-id" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8831
+ Processing by DigitalAssetsController#show as JSON
8832
+ Parameters: {"id"=>"foo-bar-id"}
8833
+ Completed 200 OK in 33.0ms (Views: 18.0ms)
8834
+ Started GET "/digital_assets/not-found-doc" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8835
+ Processing by DigitalAssetsController#show as JSON
8836
+ Parameters: {"id"=>"not-found-doc"}
8837
+ Completed 404 Not Found in 60.0ms (Views: 2.0ms)
8838
+ Started PUT "/digital_assets/foo-bar-digital-asset-id" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8839
+ Processing by DigitalAssetsController#update as JSON
8840
+ Parameters: {"digital_asset"=>{"audiences"=>["investor"], "omniture_codes"=>["KOW2MY24D"], "orderable"=>"false", "pages"=>"1", "fund_codes"=>["00200", "00190", "00210"], "_id"=>"foo-bar-digital-asset-id", "title"=>"another title", "changed_at"=>"2014-02-03 19:47:54 UTC", "digital_asset_id"=>"foo-bar-digital-asset-id", "published_at"=>"2014-01-26 19:47:54 UTC", "expires_at"=>"2014-04-05 19:47:54 UTC", "sami_code"=>"IL1111.077", "business_owner"=>"biz owner", "path"=>"/9/foo/bar.txt", "finra_path"=>"/path/finradoc/10/foo/bar.txt", "legacy_path"=>"/oldpath/10/foo/bar.txt", "doc_changed_at"=>"2014-02-03 19:47:54 UTC", "content_type"=>"fact_sheet", "updated_at"=>"2014-02-05 19:47:55 UTC", "created_at"=>"2014-02-05 19:47:55 UTC"}, "id"=>"foo-bar-digital-asset-id"}
8841
+ Completed 200 OK in 20.0ms
8842
+ Started POST "/digital_assets" for 127.0.0.1 at 2014-02-05 12:47:55 -0700
8843
+ Processing by DigitalAssetsController#create as JSON
8844
+ Parameters: {"digital_asset"=>{"audiences"=>["investor"], "omniture_codes"=>["KOW2MY24D"], "orderable"=>"false", "pages"=>"1", "fund_codes"=>["00200", "00190", "00210"], "_id"=>"52f2956bf2e6192b5278414a", "title"=>"Doc Title", "changed_at"=>"2014-02-03 19:47:54 UTC", "digital_asset_id"=>"new-digital-asset-id", "published_at"=>"2014-01-26 19:47:54 UTC", "expires_at"=>"2014-04-05 19:47:54 UTC", "sami_code"=>"IL1111.077", "business_owner"=>"biz owner", "path"=>"/10/foo/bar.txt", "finra_path"=>"/path/finradoc/11/foo/bar.txt", "legacy_path"=>"/oldpath/11/foo/bar.txt", "doc_changed_at"=>"2014-02-03 19:47:54 UTC", "content_type"=>"fact_sheet"}}
8845
+ Completed 201 Created in 29.0ms
8846
+ Started DELETE "/digital_assets/foo-bar-digital-asset-id" for 127.0.0.1 at 2014-02-05 12:47:56 -0700
8847
+ Processing by DigitalAssetsController#destroy as JSON
8848
+ Parameters: {"id"=>"foo-bar-digital-asset-id"}
8849
+ Completed 200 OK in 5.0ms
8850
+ Started POST "/digital_assets/updated_time" for 127.0.0.1 at 2014-02-05 12:47:56 -0700
8851
+ Processing by DigitalAssetsController#updated_time as JSON
8852
+ Parameters: {"ids"=>["id-1", "id-2", "id-3", "id-4"]}
8853
+ Completed 200 OK in 25.0ms (Views: 0.0ms)
8854
+ Processing by DigitalAssetsController#index as HTML
8855
+ Completed 406 Not Acceptable in 1.0ms
8856
+ Processing by DigitalAssetsController#show as HTML
8857
+ Parameters: {"id"=>"id-foobar-permanent-9"}
8858
+ Completed 406 Not Acceptable in 5.0ms
8859
+ Processing by DigitalAssetsController#show as HTML
8860
+ Parameters: {"id"=>"IL1111.077"}
8861
+ Completed 406 Not Acceptable in 5.0ms
8862
+ Processing by DigitalAssetsController#show as HTML
8863
+ Parameters: {"id"=>"IL1111.077"}
8864
+ Completed 406 Not Acceptable in 5.0ms
8865
+ Processing by DigitalAssetsController#show as HTML
8866
+ Parameters: {"id"=>"id-foobar-permanent-13"}
8867
+ Completed 406 Not Acceptable in 4.0ms
8868
+ Processing by DigitalAssetsController#search as HTML
8869
+ Completed 406 Not Acceptable in 1.0ms
8870
+ Processing by DigitalAssetsController#search as HTML
8871
+ Parameters: {"path"=>"/one/off.path"}
8872
+ Completed 406 Not Acceptable in 1.0ms
8873
+ Processing by DigitalAssetsController#search as HTML
8874
+ Parameters: {"doctype"=>"fact_sheet"}
8875
+ Completed 406 Not Acceptable in 4.0ms
8876
+ Processing by DigitalAssetsController#search as HTML
8877
+ Parameters: {"doctype"=>["fact_sheet", "prospectus"]}
8878
+ Completed 406 Not Acceptable in 1.0ms
8879
+ Processing by DigitalAssetsController#search as HTML
8880
+ Parameters: {"sami"=>"SOMETHING.001"}
8881
+ Completed 406 Not Acceptable in 1.0ms
8882
+ Processing by DigitalAssetsController#search as HTML
8883
+ Parameters: {"audience"=>"492"}
8884
+ Completed 406 Not Acceptable in 1.0ms
8885
+ Processing by DigitalAssetsController#search as HTML
8886
+ Parameters: {"title"=>"Doc Title"}
8887
+ Completed 406 Not Acceptable in 1.0ms
8888
+ Processing by DigitalAssetsController#search as HTML
8889
+ Parameters: {"digital_asset_id"=>"id-foobar-permanent-35"}
8890
+ Completed 406 Not Acceptable in 2.0ms
8891
+ Processing by DigitalAssetsController#search as HTML
8892
+ Parameters: {"business_owner"=>"biz owner"}
8893
+ Completed 406 Not Acceptable in 2.0ms
8894
+ Processing by DigitalAssetsController#search as HTML
8895
+ Parameters: {"digital_asset_id"=>"id-foobar-permanent-42", "title"=>"Doc Title"}
8896
+ Completed 406 Not Acceptable in 3.0ms
8897
+ Processing by DigitalAssetsController#search as HTML
8898
+ Parameters: {"title"=>"Doc Title", "audiences"=>["investor"], "sami"=>"IL1111.077"}
8899
+ Completed 406 Not Acceptable in 1.0ms
8900
+ Processing by DigitalAssetsController#search as HTML
8901
+ Parameters: {"digital_asset_id"=>"blargh-blargh-blargh", "title"=>"Doc Title"}
8902
+ Completed 406 Not Acceptable in 1.0ms
@@ -1 +1 @@
1
- last_read_time: 2014-01-29 15:53:44 -0700
1
+ last_read_time: 2014-02-05 12:48:02 -0700
@@ -1 +1 @@
1
- last_read_time: 2014-01-29 15:53:48 -0700
1
+ last_read_time: 2014-02-05 12:48:06 -0700
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sbhatia
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-04 00:00:00.000000000 Z
12
+ date: 2014-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails