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

749 equipment max checkout #778

Merged
merged 14 commits into from
Jul 30, 2014
Merged

749 equipment max checkout #778

merged 14 commits into from
Jul 30, 2014

Conversation

squidgetx
Copy link
Contributor

Resolves #749

@@ -28,6 +30,13 @@ class Category < ActiveRecord::Base
# table_name is needed to resolve ambiguity for certain queries with 'includes'
scope :active, where("#{table_name}.deleted_at is null")

#def renewal_not_longer_than_checkout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to leave this commented-out code in?

@squidgetx
Copy link
Contributor Author

I was originally going to remove validate_renew as a method since we could add in validations ensuring checkout length >= renewal length but I realized that validate_renew is still needed to override overdue validations. So we might as well keep the duration validation overridden too. This is why there is all the commented out code; I'll remove it

placeholder: 'Start typing an equipment model name', collection:

<%= f.association :associated_equipment_models, input_html: {class: 'input-xlarge'},
placeholder: 'Start typing an equipment model name', collection:
EquipmentModel.find(:all, conditions: ["id != ?", params[:id]]) %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is now erring and telling me

Couldn't find all EquipmentModels with 'id': (all, {:conditions=>["id != ?", "6"]}) (found 0 results, but was looking for 2)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's the trace (not super helpful tho):

app/views/equipment_models/_form.html.erb:12:in `block in _app_views_equipment_models__form_html_erb___1671969997400540714_70014930452620'
app/views/equipment_models/_form.html.erb:1:in `_app_views_equipment_models__form_html_erb___1671969997400540714_70014930452620'
app/views/equipment_models/edit.html.erb:3:in `_app_views_equipment_models_edit_html_erb___3156120513192557427_70014930401300'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a rails 4 deprecation, we can rewrite that line using a where in a block

<section id="details">
<h2>Details</h2><hr />
<!-- Title Row -->
<%= content_tag :div, :class => 'row' do %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was all this? ERB generating div tags?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup :P

@orenyk
Copy link
Contributor

orenyk commented Jul 30, 2014

I'm getting an error when I try to create fresh databases and migrate them:

NameError: uninitialized constant MoveAdminNotesToComments::ActiveAdmin
/home/oren/ruby_projects/STC/reservations/db/migrate/20140611142209_move_admin_notes_to_comments.rb:12:in `up'

Steps to replicate:

rake db:drop
rake db:create
rake db:migrate

This meant that I couldn't run the test suite locally, or rather, when I did there were over 300 failures :-P. Can someone else check and see if this happens for them?

EDIT This is happening on other branches as well; I'm investigating...

@orenyk
Copy link
Contributor

orenyk commented Jul 30, 2014

Ok, figured out how to run tests (see #853); assuming they all pass locally (which is expected) I'll merge this in.

orenyk added a commit that referenced this pull request Jul 30, 2014
add optional max checkout length to equipment models
@orenyk orenyk merged commit 2f1a2b7 into master Jul 30, 2014
@dgoerger dgoerger deleted the 749_equipment_max_checkout branch July 30, 2014 23:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should equipment models have their own max checkout length?
3 participants