anton effendi wrote: > I want to make upload photo with attachment_fu..... > > this logic is > if admin > > has_attachment :content_type => :image, > :storage => :file_system, > :path_prefix => 'public/photos', > :processor => 'Rmagick', > :thumbnails => {:standard => "520x520>", *:thumb => > "110x110>"*, :medium => "250x250>"}, > :size => 0.kilobytes..5000.kilobytes > > > if user > has_attachment :content_type => :image, > :storage => :file_system, > :path_prefix => 'public/photos', > :processor => 'Rmagick', > :thumbnails => {:standard => "520x520>", *:thumb => > "120x120>"*, :medium => "250x250>"}, > :size => 0.kilobytes..5000.kilobytes > > > I want to make it in 1 model... because I save to 1 table...
Put these in Admin and OrdinaryUser sub-classes/sub-models of your main User model. If you add an STI "type" field to this model then both these models will still use the users table if you properly instantiate them. -- Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---