Skip to content

Commit

Permalink
fixes theforeman#1691 - allow searching for fact values for hosts ins…
Browse files Browse the repository at this point in the history
…ide a hostgroup
  • Loading branch information
ohadlevy committed Jun 20, 2012
1 parent aec3e0d commit 18c29e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/fact_value.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
class FactValue < Puppet::Rails::FactValue
belongs_to :host #ensures we uses our Host model and not Puppets
delegate :name, :to => :fact_name
has_many :hostgroup, :through => :host

scoped_search :on => :value, :in_key=> :fact_name, :on_key=> :name, :rename => :facts, :complete_value => true
scoped_search :on => :value, :default_order => true
scoped_search :in => :fact_name, :on => :name, :complete_value => true, :alias => "fact"
scoped_search :in => :host, :on => :name, :rename => :host, :complete_value => true
scoped_search :in => :hostgroup, :on => :name, :rename => :"host.hostgroup", :complete_value => true

scope :no_timestamp_facts, :include => [:fact_name],
:conditions => ["fact_names.name <> ?",:_timestamp]
Expand Down

0 comments on commit 18c29e6

Please sign in to comment.