Also worth noting that ActiveRecord 3 had problems doing simple
matching queries when the data was serialized, which caused basic spec
tests to fail.  It serialized the data going into the database, but if
you did a string comparison query it didn't deserialize before doing
the comparison.  Nick, you mentioned you were going to file a Rails
bug report on this?

The Hudson box that runs the spec tests has active_record 2.3.8
installed, so it didn't catch this.  Dom, I don't think that it's
worth running different versions of active record as part of our
planned 'testing matrix' to begin with, but maybe something to
consider down the road if we start encountering more issues with
active_record versions.
Matt

On Wed, Mar 9, 2011 at 1:43 PM, Nick Lewis <[email protected]> wrote:
> This is not necessary because fact values are always strings, and it wasn't
> doing the unnecessary job it was expected to do anyway.
>
> Signed-off-by: Nick Lewis <[email protected]>
> ---
>  .../indirector/facts/inventory_active_record.rb    |    3 ---
>  lib/puppet/rails/inventory_fact.rb                 |    1 -
>  .../facts/inventory_active_record_spec.rb          |    6 ------
>  3 files changed, 0 insertions(+), 10 deletions(-)
>
> diff --git a/lib/puppet/indirector/facts/inventory_active_record.rb 
> b/lib/puppet/indirector/facts/inventory_active_record.rb
> index 2c2597f..89edaf3 100644
> --- a/lib/puppet/indirector/facts/inventory_active_record.rb
> +++ b/lib/puppet/indirector/facts/inventory_active_record.rb
> @@ -8,9 +8,6 @@ class Puppet::Node::Facts::InventoryActiveRecord < 
> Puppet::Indirector::ActiveRec
>     return nil unless node
>     facts = Puppet::Node::Facts.new(node.name, node.facts_to_hash)
>     facts.timestamp = node.timestamp
> -    facts.values.each do |key,value|
> -      facts.values[key] = value.first if value.is_a?(Array) && value.length 
> == 1
> -    end
>     facts
>   end
>
> diff --git a/lib/puppet/rails/inventory_fact.rb 
> b/lib/puppet/rails/inventory_fact.rb
> index 0339433..aa6334e 100644
> --- a/lib/puppet/rails/inventory_fact.rb
> +++ b/lib/puppet/rails/inventory_fact.rb
> @@ -2,5 +2,4 @@ require 'puppet/rails/inventory_node'
>
>  class Puppet::Rails::InventoryFact < ::ActiveRecord::Base
>   belongs_to :node, :class_name => "Puppet::Rails::InventoryNode"
> -  serialize :value
>  end
> diff --git a/spec/unit/indirector/facts/inventory_active_record_spec.rb 
> b/spec/unit/indirector/facts/inventory_active_record_spec.rb
> index ca16606..c29e584 100644
> --- a/spec/unit/indirector/facts/inventory_active_record_spec.rb
> +++ b/spec/unit/indirector/facts/inventory_active_record_spec.rb
> @@ -88,12 +88,6 @@ describe "Puppet::Node::Facts::InventoryActiveRecord", :if 
> => (Puppet.features.r
>     it "should return nil if no node instance can be found" do
>       Puppet::Node::Facts.find("non-existent node").should == nil
>     end
> -
> -    it "should convert all single-member arrays into non-arrays" do
> -      Puppet::Node::Facts.new("array", "fact1" => ["value1"]).save
> -
> -      Puppet::Node::Facts.find("array").values["fact1"].should == "value1"
> -    end
>   end
>
>   describe "#search" do
> --
> 1.7.4.1
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to