Hi all;

In Hobo 2.1.1, I'm creating an array of OpenStructs to pass back to a 
table-plus for display. This certainly works nicely in Hobo 2.0/Ruby 1.9.3, 
but I'm getting an odd error with 2.1.1/Rails 4.0.8/Ruby/2.1.4:

  undefined method `method_defined?' for #<Array:0x007fdb88622170>
  app/views/taglibs/application/company.dryml:848:in `block (8 levels) in 
show_page__for_company'


The Array I pass to a table-plus tag is created as follows:

 def get_documents
    documents = Array.new
    files = Dir.glob(folder + "*.{pdf,PDF}")
    ...

    # Go through each of the files retrieved, and extract their details to 
be usable
    r = 0                
  
    files.each do |doc|
      filing_date = "Unknown"
      filing = "Unknown"
    
      filing_date, filing, filing_year = Filings.decode_filename(doc, 
self.entity_type_code)
            
      if filing.present? 
         documents[r] = OpenStruct.new(:doc_id => doc, :filing_date => 
filing_date, :filing => filing, :filing_year => filing_year)
         r = r + 1
      end
    end 
    return documents
  end  
  
A sample Array I passed to the table-plus tag is as follows:

[
#<OpenStruct doc_id="711021-140619-IN.PDF", filing_date="140619", 
filing="Incorporation", filing_year="NA">, 
#<OpenStruct doc_id="711021-140619-ND.PDF", filing_date="140619", 
filing="Notice/Change of Directors", filing_year="NA">
]

And, the table-plus tag is nothing unusual:

    <% documents = this.get_documents %>
            <if test="&documents.present?">
              <table-plus with="&documents" 
fields="filing,filing_date,filing_year, doc_id">
              </table-plus>
            </if>

Does anyone know why this might be causing the *undefined method 
`method_defined?' for Array* error? 

Some new anomaly with Rails 4 / Ruby 2?

Many thanks,
Tim




-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to