How to pass model names?

The scenario is that i have written a function in application_hepler.rb
as like..

def all_record_ids(model_name)
  all_records = model_name.all.find_all {
    |record| record.status == "ACTIVE"
  }
end

I am calling this function as like  [ all_record_ids("Employee") ] but
instead of getting result i am getting error as  [ "undefined method
`all' for "Employee":String" ]


So what is wrong here .. ? Can you guys light me up some direction ?
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to