Support for Arrays? #1

Closed
schneems opened this Issue Nov 11, 2011 · 1 comment

Comments

Projects
None yet
2 participants
Member

schneems commented Nov 11, 2011

Can I do this or do i need to iterate over my collection to call boxer.ship

Boxer.ship(:course, Course.all)
NoMethodError: undefined method `title' for #<Array:0x007f8efb555528>
    from (irb):7:in `block (2 levels) in irb_binding'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/boxer-1.0.2/lib/boxer.rb:78:in `call'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/boxer-1.0.2/lib/boxer.rb:78:in `block in ship'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/boxer-1.0.2/lib/boxer.rb:77:in `each'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/boxer-1.0.2/lib/boxer.rb:77:in `inject'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/boxer-1.0.2/lib/boxer.rb:77:in `ship'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/boxer-1.0.2/lib/boxer.rb:45:in `ship'
    from (irb):40
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in `start'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in `start'
    from /Users/schneems/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/commands.rb:23:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Boxer.ship(:course, Course.first)
 => {:name=>"Example Name", :price=>7.11} 

If its not supported => feature suggestion. If it is supported, any clue what i'm doing wrong?

Member

h3h commented Nov 17, 2011

I think I'm going to turn this into #2.

h3h closed this Nov 17, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment