Commit feddbd2a authored by Alexandre Friquet's avatar Alexandre Friquet

Fixes issue when attaching images and files: refs #72.

parent 2734108d
......@@ -9,3 +9,4 @@ vendor/bundle*
coverage
.env
.byebug_history
*.swp
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class AttachedFile < ApplicationRecord
belongs_to :attachable, :polymorphic => true
belongs_to :attachable, polymorphic: true, optional: true
has_attached_file :file
validates_attachment_presence :file, :message => " : est obligatoire!"
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class Image < ApplicationRecord
belongs_to :imageable, :polymorphic => true
belongs_to :imageable, polymorphic: true, optional: true
has_attached_file :img_file,
:styles => { :thumb => "160x120^", :large => "1280x960>" },
:convert_options => { :all => '-strip -colorspace RGB'}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment