-
Notifications
You must be signed in to change notification settings - Fork 335
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
Error trying to cache RABL views #413
Comments
This may be a bug in Rails. The error is very similar to this bug and changing the objects I am passing into the partials into arrays seems to fix it. cache [root_object, root_object.teams.to_a] # << Notice the `to_a`
node :teams do |employee|
partial "teams/index", object: employee.teams.to_a # << Notice the `to_a`
end Having to do this everywhere seems like a pretty lame solution. Any other thoughts? |
So after more digging I think it is a little more complicated. I have narrowed it down to a specific class Employee < ActiveRecord::Base
has_many :assigned_items, class_name: ChecklistItem, finder_sql: Proc.new {
%Q{
SELECT "checklist_items".* FROM "checklist_items"
INNER JOIN "checklists" ON "checklists"."id" = "checklist_items"."checklist_id"
WHERE "checklist_items"."employee_id" = #{id} AND "checklist_items"."active" = 't' AND "checklists"."active" = 't'
ORDER BY "checklist_items".created_at
}
}
end Looks like the |
While their could be a problem in Rails, I am starting to think this is a |
@andrewhubbs did you ever find a solution to this? I'm running into the same issue |
+1 |
The basic error I am getting is this:
My views look something like this:
Any thoughts on what is going on here?
Relevant config:
The text was updated successfully, but these errors were encountered: