roqua-core-api 0.0.26 → 0.0.27

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: 601eda66c40f7460205cf7cb85a05fbe36845a14
4
- data.tar.gz: 79814be6c1ceb439979413e512732ab2b8bebac8
3
+ metadata.gz: 23e0e206f098bcf278fa81bfc085489c08bcb213
4
+ data.tar.gz: 774b7b841acc9a2fc4074f54125ca7014137f489
5
5
  SHA512:
6
- metadata.gz: d2887a4630ec97c1bab5b1334642fedd9ca86c39c2723ae7cdb86b23b63d55e2da46d63a03f31ad697fcb871681d778beb9a36dbbf68a91ae975c214f961409b
7
- data.tar.gz: 4b2ddc7d569abc704bcf899c4d2f3ca21c2e93b4f62a44e28d15e7c12f87b542fa5e8abfad236265fc6f18412179d2ba966d310e97d177ed283f7b9895572b09
6
+ metadata.gz: 4f96fd0241be3059e1dec48b62a297172396b8694719110385ae7b97b422dfd88a453496c4c89c435476100fd56d4ac4a052c7d73c0c509de6388b1ca0f017df
7
+ data.tar.gz: b088425d466a61724322cdca7e2c34a3468278fc546b7366ac9a6aef231b6e6b6207dda1bc73642e5d29e9831300ed25148d0f518c6d058df312deedc38c81ba
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.0.27 / 2014-04-29
2
+
3
+ * Added ENV['LOGIN_TITLE'] option to set a title for the login screen on Core.
4
+
1
5
  ### 0.0.26 / 2014-04-17
2
6
 
3
7
  * Fixed Person.birthdate being settable by birthdate(1i) type params
data/Gemfile CHANGED
@@ -11,6 +11,7 @@ group :development do
11
11
  end
12
12
 
13
13
  group :test do
14
+ gem 'guard', '~> 2.6.0'
14
15
  gem 'guard-rspec', '~> 4.2.6'
15
16
  gem 'fuubar', '~> 1.3.2'
16
17
  end
@@ -8,7 +8,7 @@ module Roqua
8
8
 
9
9
  def execute
10
10
  response = session.post "/dossier_groups", dossier_group: attributes, organization_id: organization_id
11
- Models::DossierGroup.new(response)
11
+ Models::DossierGroup.new(response["dossier_group"])
12
12
  end
13
13
  end
14
14
  end
@@ -0,0 +1,13 @@
1
+ module Roqua
2
+ module CoreApi
3
+ # @api private
4
+ class DossierGroups < ActiveInteraction::Base
5
+ model :session, class: Sessions::OAuthSession
6
+
7
+ def execute
8
+ response = session.get "/dossier_groups"
9
+ response['dossier_groups'].map { |attrs| Models::DossierGroup.new(attrs) }
10
+ end
11
+ end
12
+ end
13
+ end
@@ -9,7 +9,7 @@ class Roqua::CoreApi::Models::ActiveVirtus
9
9
  include Virtus.model
10
10
 
11
11
  def attributes=(params)
12
- set_rails_dates(params)
12
+ dates_from_xi(params)
13
13
  super
14
14
  end
15
15
 
@@ -20,15 +20,16 @@ class Roqua::CoreApi::Models::ActiveVirtus
20
20
  private
21
21
 
22
22
  # set Date and DateTime attributes by "name(1i)" style params
23
- def set_rails_dates(params)
24
- self.class.attribute_set.select do |a|
25
- a.type.primitive <= Date && params.has_key?("#{a.name}(1i)")
26
- end.each do |a|
27
- set_date(a.name, params)
23
+ def dates_from_xi(params)
24
+ dates_to_change = self.class.attribute_set.select do |a|
25
+ a.type.primitive <= Date && params.key?("#{a.name}(1i)")
26
+ end
27
+ dates_to_change.each do |a|
28
+ date_from_xi(a.name, params)
28
29
  end
29
30
  end
30
31
 
31
- def set_date(attribute, params)
32
+ def date_from_xi(attribute, params)
32
33
  self[attribute] = {
33
34
  year: params.fetch("#{attribute}(1i)"),
34
35
  month: params.fetch("#{attribute}(2i)", 1),
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module CoreApi
3
- VERSION = '0.0.26'
3
+ VERSION = '0.0.27'
4
4
  end
5
5
  end
@@ -3,6 +3,7 @@ require 'roqua/core_api/version'
3
3
  require 'roqua/core_api/sessions'
4
4
  require 'roqua/core_api/models'
5
5
  require 'roqua/core_api/dossiers'
6
+ require 'roqua/core_api/dossier_groups'
6
7
  require 'roqua/core_api/create_dossier'
7
8
  require 'roqua/core_api/create_dossier_group'
8
9
  require 'roqua/core_api/send_email_to'
@@ -7,5 +7,6 @@ Rails.application.config.middleware.use OmniAuth::Builder do
7
7
  provider :doorkeeper,
8
8
  ENV.fetch('CORE_OAUTH_CLIENT_ID'),
9
9
  ENV.fetch('CORE_OAUTH_CLIENT_SECRET'),
10
- client_options: {site: ENV.fetch('CORE_SITE')}
10
+ client_options: {site: ENV.fetch('CORE_SITE')},
11
+ authorize_params: {login_title: ENV['CORE_LOGIN_TITLE']}
11
12
  end
@@ -4,15 +4,16 @@ describe CreateDossierGroup do
4
4
  let(:session) { Fabricate :oauth_session }
5
5
 
6
6
  it 'performs a post on the /dossier_groups api path' do
7
- expect(session).to receive(:post).with '/dossier_groups', dossier_group: {some: 'attributes'},
8
- organization_id: 'some_organization_id'
7
+ expect(session).to receive(:post).with('/dossier_groups', dossier_group: {some: 'attributes'},
8
+ organization_id: 'some_organization_id')
9
+ .and_return("dossier_group" => {})
9
10
  CreateDossierGroup.run!(session: session, attributes: {some: 'attributes'}, organization_id: 'some_organization_id')
10
11
  end
11
12
 
12
- it 'returns a Dossier model' do
13
+ it 'returns a DossierGroup model' do
13
14
  allow(session).to receive(:post).with('/dossier_groups', dossier_group: {some: 'attributes'},
14
15
  organization_id: 'some_organization_id')
15
- .and_return 'id' => 'some_id', 'name' => 'some_name'
16
+ .and_return('dossier_group' => {'id' => 'some_id', 'name' => 'some_name'})
16
17
  dossier_group = CreateDossierGroup.run!(session: session,
17
18
  attributes: {some: 'attributes'},
18
19
  organization_id: 'some_organization_id')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-core-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-17 00:00:00.000000000 Z
11
+ date: 2014-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -185,6 +185,7 @@ files:
185
185
  - lib/roqua/core_api.rb
186
186
  - lib/roqua/core_api/create_dossier.rb
187
187
  - lib/roqua/core_api/create_dossier_group.rb
188
+ - lib/roqua/core_api/dossier_groups.rb
188
189
  - lib/roqua/core_api/dossiers.rb
189
190
  - lib/roqua/core_api/models.rb
190
191
  - lib/roqua/core_api/models/active_virtus.rb