software.rb
586 Bytes
class Software < Organization
SEARCHABLE_SOFTWARE_FIELDS = {
:name => 1,
:identifier => 2,
:nickname => 3
}
SEARCH_FILTERS = {
:order => %w[],
:display => %w[full]
}
def self.default_search_display
'full'
end
settings_items :hits, :type => :integer, :default => 0
has_one :software_info
validates_presence_of :software_info
attr_accessible :software_info
after_save { software_info.save! }
#FIXME This is a performance bottleneck on heavy loads.
def hit
self.hits += 1
self.save!
end
def software?
true
end
end