Skip to content

Commit

Permalink
Adding the Vocab Module into the autoload_paths for the Application i…
Browse files Browse the repository at this point in the history
…nstance; Replacing the URIs within the Model Concerns with those constants exposed by Vocab::GeoTerms
  • Loading branch information
griffinj@lafayette.edu committed Nov 16, 2015
1 parent a7b6029 commit 883cb8b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/concerns/external_metadata_file_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module ExternalMetadataFileBehavior

type [Hydra::PCDM::Vocab::PCDMTerms.Object,
Hydra::Works::Vocab::WorksTerms.GenericFile,
'http://projecthydra.org/geoconcerns/models#ExternalMetadataFile']
Vocab::GeoTerms.ExternalMetadataFile]
end

# Defines type by what it is and isn't
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/image_file_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module ImageFileBehavior
included do
type [Hydra::PCDM::Vocab::PCDMTerms.Object,
Hydra::Works::Vocab::WorksTerms.GenericFile,
'http://projecthydra.org/geoconcerns/models#ImageFile']
Vocab::GeoTerms.ImageFile]
end

# Defines type by what it is and isn't
Expand Down
3 changes: 2 additions & 1 deletion app/models/concerns/image_work_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Attributes and methods for image works
module ImageWorkBehavior
extend ActiveSupport::Concern

included do
type [Hydra::PCDM::Vocab::PCDMTerms.Object,
Hydra::Works::Vocab::WorksTerms.GenericWork,
'http://projecthydra.org/geoconcerns/models#ImageWork']
Vocab::GeoTerms.ImageWork]
end

def image_file
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/raster_file_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module RasterFileBehavior
included do
type [Hydra::PCDM::Vocab::PCDMTerms.Object,
Hydra::Works::Vocab::WorksTerms.GenericFile,
'http://projecthydra.org/geoconcerns/models#RasterFile']
Vocab::GeoTerms.RasterFile]
end

# Defines type by what it is and isn't
Expand Down
3 changes: 2 additions & 1 deletion app/models/concerns/raster_work_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Attributes and methods for raster works
module RasterWorkBehavior
extend ActiveSupport::Concern

included do
type [Hydra::PCDM::Vocab::PCDMTerms.Object,
Hydra::Works::Vocab::WorksTerms.GenericWork,
'http://projecthydra.org/geoconcerns/models#RasterWork']
Vocab::GeoTerms.RasterWork]
end

def raster_files
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/vector_file_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module VectorFileBehavior
included do
type [Hydra::PCDM::Vocab::PCDMTerms.Object,
Hydra::Works::Vocab::WorksTerms.GenericFile,
'http://projecthydra.org/geoconcerns/models#VectorFile']
Vocab::GeoTerms.VectorFile]
end

# Defines type by what it is and isn't
Expand Down
3 changes: 2 additions & 1 deletion app/models/concerns/vector_work_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Attributes and methods for vector works
module VectorWorkBehavior
extend ActiveSupport::Concern

included do
type [Hydra::PCDM::Vocab::PCDMTerms.Object,
Hydra::Works::Vocab::WorksTerms.GenericWork,
'http://projecthydra.org/geoconcerns/models#VectorWork']
Vocab::GeoTerms.VectorWork]
end

def vector_files
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ class Application < Rails::Application

# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true

config.autoload_paths << "#{Rails.root}/lib"
end
end

0 comments on commit 883cb8b

Please sign in to comment.