only show item zones on outfits#edit occupies filter helper
This commit is contained in:
parent
5e37063674
commit
e71530a958
2 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
class ItemZoneSetsController < ApplicationController
|
||||
def index
|
||||
render :json => Zone.all_plain_labels
|
||||
render :json => Zone.for_items.all_plain_labels
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,13 +13,14 @@ class Zone < ActiveRecord::Base
|
|||
t = Zone::Translation.arel_table
|
||||
includes(:translations).where(t[:plain_label].eq(Zone.plainify_label(label)))
|
||||
}
|
||||
scope :for_items, lambda { where(arel_table[:type_id].gt(1)) }
|
||||
|
||||
def uncertain_label
|
||||
@sometimes ? "#{label} sometimes" : label
|
||||
end
|
||||
|
||||
def self.all_plain_labels
|
||||
Zone.select([:id]).includes(:translations).all.map(&:plain_label).uniq.sort
|
||||
select([:id]).includes(:translations).all.map(&:plain_label).uniq.sort
|
||||
end
|
||||
|
||||
def self.plainify_label(label)
|
||||
|
|
Loading…
Reference in a new issue