Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.64 KB | None | 0 0
  1. require 'application'
  2. #require 'user'
  3.  
  4. module LocalAvatarsPlugin
  5.   module UsersAvatarPatch
  6.     def self.included(base) # :nodoc:
  7.       base.class_eval do
  8.         unloadable
  9.                         has_many :attachments, {:as => :container,
  10.                                                                                                                         :order => "#{Attachment.table_name}.created_on",
  11.                                                                                                                         :dependent => :destroy}
  12.       end
  13.     end
  14.   end
  15. end
  16. User.send(:include, LocalAvatarsPlugin::UsersAvatarPatch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement