Displaying 3 results from an estimated 3 matches for "closed_at".
2006 May 02
5
listing parents from child conditon
...g on a condition in the
children table ?
Fx.
def list
@projects = Project.find(:all)
end
will find all projects in my table. Now let''s say I want show a similar
list, for all open projects.. I define an open project, as all lines
(Line has belongs_to :Project) that do not yet have a closed_at
timestamp set.
So basically, I want all projects, where project.line.closed_at is NULL.
How would I do that ?
/mich
--
Posted via http://www.ruby-forum.com/.
2006 Jul 31
2
ambiguous column name in has_many :through
...gs_to :project
end
When I attempt to grab an account''s items through @my_account.items
everything is fine. However, when I try to find the late items with
@my_account.late_items I get a RuntimeError:
ActiveRecord::StatementInvalid: RuntimeError: ERROR C42702 Mcolumn
reference "closed_at" is ambiguous Fparse_relation.c L360
RscanRTEForColumn: SELECT items.* FROM items INNER JOIN projects ON
items.project_id = projects.id WHERE (projects.account_id = NULL AND
(closed_at IS NULL AND due_on < ''2006-07-31 13:40:17''))
from C:/ruby/lib/rub...
2006 Nov 01
17
So how can I rewrite my app without using with_scope?
So, I hear that with_scope is going to be deprecated.
Which is a bit of a shame, given the stuff I''ve been writing recently.
I have a CMS with multiple clients. A ''client'' is essentially a
company, with multiple users. Content on the site belongs to a client
- content could be messages, images, schedules, etc etc. People
belonging to one client should not be able