I found a more simple solotion now

  def self.last_avatar
      Avatar.find(:last)
  end

  def self.new_avatar_size
     last_avatar.avatar_size
     rescue
     "48x48"
  end


  has_attached_file :avatar, :styles => { :small => new_avatar_size, 
:large => "500x500>" },


The only problem left now is

When two users doo create an avatar on same time the and one of them is 
faster he got's the size of last user

I can't use conditions into the model


request.remote_ip doesn't work in model, also cookies is not usable for 
find the richt id
-- 
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