Commit b7184fde authored by David F.'s avatar David F.

Merge branch '72-impossible-d-attacher-une-image-ni-un-fichier-joint' into 'master'

Resolve "Impossible d'attacher une image ni un fichier joint"

See merge request !74
parents 2734108d feddbd2a
......@@ -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