Skip to content

Commit

Permalink
Merge pull request #12 from hathitrust/DEV-994_part_deux_revenge_of_t…
Browse files Browse the repository at this point in the history
…he_views

Rights API: OFFSET and LIMIT Queries (part deux: talking to a real da…
  • Loading branch information
moseshll authored Mar 11, 2024
2 parents fa5fa15 + 8c9893a commit 9e2367f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rights_api/models/access_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module RightsAPI
class AccessProfile < Sequel::Model
extend ModelExtensions
set_primary_key :id

def to_h
{
Expand Down
1 change: 1 addition & 0 deletions lib/rights_api/models/access_statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module RightsAPI
class AccessStatement < Sequel::Model(:access_stmts)
extend ModelExtensions
set_primary_key :stmt_key

def self.default_key
:stmt_key
Expand Down
1 change: 1 addition & 0 deletions lib/rights_api/models/access_statement_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module RightsAPI
class AccessStatementMap < Sequel::Model(:access_stmts_map)
extend ModelExtensions
set_primary_key [:a_attr, :a_access_profile]

def self.default_key
:attr_access_id
Expand Down
1 change: 1 addition & 0 deletions lib/rights_api/models/attribute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module RightsAPI
class Attribute < Sequel::Model
extend ModelExtensions
set_primary_key :id

def to_h
{
Expand Down
1 change: 1 addition & 0 deletions lib/rights_api/models/reason.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module RightsAPI
class Reason < Sequel::Model
extend ModelExtensions
set_primary_key :id

def to_h
{
Expand Down
1 change: 1 addition & 0 deletions lib/rights_api/models/rights_current.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class RightsCurrent < Sequel::Model(:rights_current)
many_to_one :attribute_obj, class: :"RightsAPI::Attribute", key: :attr
many_to_one :reason_obj, class: :"RightsAPI::Reason", key: :reason
many_to_one :source_obj, class: :"RightsAPI::Source", key: :source
set_primary_key [:namespace, :id]

# Maybe TOO eager. This makes us partially responsible for the fact that rights_current.source
# has an embedded access_profile.
Expand Down
1 change: 1 addition & 0 deletions lib/rights_api/models/rights_log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class RightsLog < Sequel::Model(:rights_log)
many_to_one :attribute_obj, class: :"RightsAPI::Attribute", key: :attr
many_to_one :reason_obj, class: :"RightsAPI::Reason", key: :reason
many_to_one :source_obj, class: :"RightsAPI::Source", key: :source
set_primary_key [:namespace, :id]

# Maybe TOO eager. This makes us partially responsible for the fact that rights_current.source
# has an embedded access_profile.
Expand Down

0 comments on commit 9e2367f

Please sign in to comment.