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

TableBuilder expects an Array or ActiveRecord::NamedScope::Scope but found a Array #5

Open
dza2000 opened this issue Dec 4, 2010 · 1 comment

Comments

@dza2000
Copy link

dza2000 commented Dec 4, 2010

So, as you can read, TableBuilder is throwing an error because it expected an Array, but found an... Array. Not sure why this is throwing an exception. Any wisdom would be appreciated.

@MDaubs
Copy link

MDaubs commented Jan 6, 2011

I'm willing to bet you are using Rails 3 and Arel, yes? If that's the case you are probably sending it an ActiveRecord::Relation. Adding a .all to the end of our query should fix the problem. Example:

# Do this
@widgets = Widget.where(:for_sale => true).all
# Instead of this
@widgets = Widget.where(:for_sale => true)

table_builder should probably be updated to support passing in a ActiveRecord::Relation.

fbatista pushed a commit to fbatista/table_builder that referenced this issue Mar 13, 2013
Allow CalendarHelper to use any object that responds to 'each'
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