Skip to content

Commit

Permalink
add service provider attributes to omb_cx_reporting_collections
Browse files Browse the repository at this point in the history
* fix query
* update gems
  • Loading branch information
ryanwoldatwork committed Sep 22, 2022
1 parent 98261eb commit 4ace767
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ GEM
acts-as-list (0.1.2)
acts-as-taggable-on (9.0.1)
activerecord (>= 6.0, < 7.1)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.632.0)
aws-partitions (1.633.0)
aws-record (2.7.0)
aws-sdk-dynamodb (~> 1.18)
aws-sdk-core (3.150.0)
aws-sdk-core (3.151.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
Expand Down Expand Up @@ -128,9 +128,9 @@ GEM
bcrypt (3.1.18)
bindata (2.4.10)
bindex (0.8.1)
bootsnap (1.12.0)
bootsnap (1.13.0)
msgpack (~> 1.2)
brakeman (5.2.3)
brakeman (5.3.1)
builder (3.2.4)
bullet (7.0.3)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -166,7 +166,7 @@ GEM
chronic (0.10.2)
coderay (1.1.3)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
connection_pool (2.3.0)
crass (1.0.6)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
Expand Down Expand Up @@ -197,7 +197,7 @@ GEM
faraday (0.17.5)
multipart-post (>= 1.2, < 3)
ffi (1.15.5)
fog-aws (3.14.0)
fog-aws (3.15.0)
fog-core (~> 2.1)
fog-json (~> 1.1)
fog-xml (~> 0.1)
Expand Down Expand Up @@ -258,7 +258,7 @@ GEM
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
logstop (0.2.8)
logstop (0.3.0)
loofah (2.19.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand All @@ -274,7 +274,7 @@ GEM
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.16.3)
msgpack (1.5.3)
msgpack (1.5.6)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.2.3)
Expand Down Expand Up @@ -327,7 +327,7 @@ GEM
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.7)
public_suffix (5.0.0)
puma (5.6.5)
nio4r (~> 2.0)
racc (1.6.0)
Expand Down Expand Up @@ -449,7 +449,7 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sidekiq (6.5.6)
sidekiq (6.5.7)
connection_pool (>= 2.2.5)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
Expand All @@ -471,7 +471,7 @@ GEM
railties (>= 6.0.0)
strscan (3.0.4)
thor (1.2.1)
tilt (2.0.10)
tilt (2.0.11)
timeout (0.3.0)
turbo-rails (1.1.1)
actionpack (>= 6.0.0)
Expand All @@ -489,7 +489,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.0.0)
webdrivers (5.1.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def api_key_format

validates :email, presence: true, if: :tld_check

scope :active, -> { where('inactive = false') }
scope :active, -> { where(inactive: false) }

scope :admins, -> { where(admin: true) }
scope :performance_managers, -> { where(performance_manager: true) }
Expand Down
13 changes: 13 additions & 0 deletions app/serializers/omb_cx_reporting_collection_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class OmbCxReportingCollectionSerializer < ActiveModel::Serializer
:organization_id,
:organization_name,
:organization_abbreviation,
:service_provider_id,
:service_provider_name,
:collection_id,
:collection_name,
:collection_year,
Expand Down Expand Up @@ -100,4 +102,15 @@ class OmbCxReportingCollectionSerializer < ActiveModel::Serializer
:service_id,
:service_name,
:service_slug


def service_provider_id
object.collection.service_provider_id
end

def service_provider_name
if object.collection.service_provider
object.collection.service_provider.name
end
end
end

0 comments on commit 4ace767

Please sign in to comment.