Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

MetaWhere::Column instead of column name #27

Closed
amcox opened this issue Jun 7, 2011 · 2 comments
Closed

MetaWhere::Column instead of column name #27

amcox opened this issue Jun 7, 2011 · 2 comments

Comments

@amcox
Copy link

amcox commented Jun 7, 2011

I'm getting the following error:

ActiveRecord::StatementInvalid PGError: ERROR: column observations.#<MetaWhere::Column:0x0000010347dcf0> does not exist

The full SQL query it's attempting is:

 SELECT "observations".* FROM "observations" WHERE (("observations"."district_id" = 1) OR (("observations"."#<MetaWhere::Column:0x0000010347dcf0>" IN (4, 1)) OR (("observations"."teacher_id" = 12) OR ("observations"."observer_id" = 12))))

I'm using MetaWhere through CanCan, so I'm not sure where the issue is located, but the line of ruby producing the issue is in the Ability class for CanCan:

can :read, Observation, :school_id.in => user.schools_over_ids

If I comment that out, no error.

I'm happy to take the issue over to CanCan if needed, but figured I'd start here. Any insights into further diagnosis would be awesome.

@amcox
Copy link
Author

amcox commented Jun 7, 2011

Digging more into the CanCan issues, it looks like it's probably over there.

@amcox
Copy link
Author

amcox commented Jun 7, 2011

My bad, cancan issue that's being worked on. Closing.

Looking forward to playing around with Squeel and Ransack soon, too.

Much thanks.

@amcox amcox closed this as completed Jun 7, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant