Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Arrays? #1

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

Support for Arrays? #1

schneems opened this issue Nov 11, 2011 · 1 comment

Comments

@schneems
Copy link
Member

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?

@h3h
Copy link
Member

h3h commented Nov 17, 2011

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

@h3h h3h closed this as completed Nov 17, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants