Help


#1

There is an Audit Type class

Each Audit Type has many Audit Items, they are accessible with the
method:

AuditType.audit_items

It is possible to expire audit items, this sets the expired column to 1.
They still need to be linked with the Audit Type though, so i can not
delete the foreign key.

When i call AuditType.audit_items i dont want the items that have been
expired to show, but i do not know how to do this. Any ideas on the
best way to do it??

Thanks,
Chris


#2

Anything specific we can help with?

Sean


#3

Some how this conjures up a scene from a John Wayne movie for me.

Adam


#4

a bit more info would be useful.

2009/7/20 removed_email_address@domain.invalid removed_email_address@domain.invalid


cashflowclublondon.co.uk

                  ("`-''-/").___..--''"`-._
                   `6_ 6  )   `-.  (     ).`-.__.`)
                   (_Y_.)'  ._   )  `._ `. ``-..-'
                 _..`--'_..-_/  /--'_.' ,'
                (il),-''  (li),'  ((!.-'

.


#5

On Thursday 07 January 2010, Jagadeesh wrote:

|> > | && (states.grep(‘open’).empty? ||states.grep
|> empty array and the puts will always be executed.
|
|Thanks

You don’t need to use grep to see whether an array contains an element.
You
can use include?:

if (states.include?(‘closed’) || states.include?(‘feedback’)) &&
(states.include?(‘open’) || states.include?(‘analyzed’))

Another aopproach is to use the Array & operator, which gives the
intersection
between two arrays. You can do something like this:

first_group = [‘open’, ‘analyzed’]
second_group = [‘closed’, ‘feedback’]

if !(states & second_group).empty? && !(states & first_group).empty?

The reasoning is that, if states contains either the ‘open’ or the
‘analyzed’
entries, then its intersection with first_group (states & first_group)
won’t
be empty. The same for the second group.

I hope this helps

Stefano