Validation in attachment_fu

Hi,

I have a doubt that how to validate in attachment_fu when 2 different
file formats(Image/Document) are used.

I have a model named Image, Documents ,

class Images < ActiveRecord::Base
has_many :attachments, :as => :parent
end

class Documents < ActiveRecord::Base
has_many :attachments, :as => :parent
end

class Attachments < ActiveRecord::Base
belongs_to :parent, :polymorphic => true
has_attachment :storage => :file_system,
:path_prefix => ‘public/attachments’,
:size => 0.kilobytes…5000.kilobytes,
:max_size => 5000.kilobytes,
:content_type =>
[‘application/pdf’,‘application/vnd.openxmlformats-officedocument.presentationml.presentation’,‘application/vnd.ms-powerpoint’,
‘application/msword’, ‘text/plain’,:image]

validates_as_attachment
end

I am uploading Image from the a view file, validation should be made
only for the Image. Please help how can i make the validation for image
& document seperately.

& When I am Uploading a Document from another view file, Validation
should be done only for documents.

Please tell me how to validate individually for images & Documents.

Thanks,
Srikanth J