Skip to content

Commit

Permalink
Allow users to search by serial number
Browse files Browse the repository at this point in the history
  • Loading branch information
drapergeek committed Feb 19, 2014
1 parent cbd74f3 commit 784dcda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Expand Up @@ -16,7 +16,8 @@ Findit.ItemsController = Ember.ArrayController.extend
@_itemMatches(item, 'name', search) ||
@_itemMatches(item, 'make', search) ||
@_itemMatches(item, 'model', search) ||
@_itemMatches(item, 'shortLocation', search)
@_itemMatches(item, 'shortLocation', search) ||
@_itemMatches(item, 'serial', search)

_itemMatches: (item, propertyName, search) ->
property = item.get(propertyName)?.toUpperCase()
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/models/item.js.coffee
Expand Up @@ -5,6 +5,7 @@ Findit.Item = DS.Model.extend
shortType: DS.attr('string')
typeOfItem: DS.attr('string')
shortLocation: DS.attr('string')
serial: DS.attr('string')

makeModel: (->
make = @get('make')
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/item_serializer.rb
@@ -1,3 +1,3 @@
class ItemSerializer < ActiveModel::Serializer
attributes :id, :name, :make, :model, :short_type, :location_id, :short_location
attributes :id, :name, :make, :model, :short_type, :location_id, :short_location, :serial
end

0 comments on commit 784dcda

Please sign in to comment.