Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1601 from YaleSTC/1600_refactor_eq_models_model_spec
Browse files Browse the repository at this point in the history
[1600] Refactor Equipment Model Model Spec
  • Loading branch information
orenyk committed Jul 14, 2016
2 parents 6e6c3d4 + af135d4 commit b89bbdd
Show file tree
Hide file tree
Showing 4 changed files with 276 additions and 386 deletions.
6 changes: 3 additions & 3 deletions app/controllers/equipment_models_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def equipment_model_params
# to resolve test failures)
params.require(:equipment_model)
.permit(:name, :category_id, :category, :description, :late_fee,
:replacement_fee, :max_per_user, :document_attributes,
:deleted_at, :photo, :documentation, :max_renewal_times,
:max_renewal_length, :renewal_days_before_due, :late_fee_max,
:replacement_fee, :max_per_user, :deleted_at, :photo,
:documentation, :max_renewal_times, :max_renewal_length,
:renewal_days_before_due, :late_fee_max,
{ associated_equipment_model_ids: [] }, :requirement_ids,
:requirements, :max_checkout_length)
.tap do |whitelisted|
Expand Down
16 changes: 0 additions & 16 deletions app/models/equipment_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ def normalized_photo_name
"#{id}-#{photo_file_name.gsub(/[^a-zA-Z0-9_\.]/, '_')}"
end
###################
## Class Methods ##
###################
# TODO: this appears to be dead code - verify and remove
def self.select_options
order('name ASC').collect { |item| [item.name, item.id] }
end
######################
## Instance Methods ##
######################
Expand All @@ -159,13 +150,6 @@ def maximum_renewal_days_before_due
renewal_days_before_due || category.maximum_renewal_days_before_due
end
# TODO: This appears to be dead code, verify and delete
def document_attributes=(document_attributes)
document_attributes.each do |attributes|
documents.build(attributes)
end
end
def active_reservations
if AppConfig.check :requests_affect_availability
reservations.not_overdue.active_or_requested
Expand Down
Loading

0 comments on commit b89bbdd

Please sign in to comment.