SammyLin / redactor-rails

This repo is deprecated. Please check out official gem for Redactor 2. https://github.com/Redactor2/redactor2_rails
MIT License
389 stars 253 forks source link

Is assets table HAVE TO belongs_to user? #124

Open adz624 opened 9 years ago

adz624 commented 9 years ago

activerecord: https://github.com/SammyLin/redactor-rails/blob/3dead6ade8dd1999aa7e9a8f764a1bd3c2275c49/lib/redactor-rails/orm/active_record.rb#L18

controller: https://github.com/SammyLin/redactor-rails/blob/master/app/controller/redactor_rails/pictures_controller.rb#L6

the logic of above code, looks like must with association with assets table. any idea to skip this for public assets.

adampope commented 8 years ago

I've just worked around this by adding

private def user
end

in my RedactorRails::Asset model to hide the association that AssetBase implements. Seems to work ok.