Add belongs_to optional true to setup_association
This commit is contained in:
1 parent
9da66fe1e6
commit
fde9d042fb
2 files changed
+8
-1
No files matched your search
@@ -12,7 +12,11 @@ module Impressionist
|
||||
end
|
||||
|
||||
def define_belongs_to
|
||||
receiver.belongs_to(:impressionable, :polymorphic => true)
|
||||
if ::Rails::VERSION::MAJOR.to_i >= 5
|
||||
receiver.belongs_to(:impressionable, :polymorphic => true, :optional => true)
|
||||
else
|
||||
receiver.belongs_to(:impressionable, :polymorphic => true)
|
||||
end
|
||||
end
|
||||
|
||||
def set
|
||||
|
||||
Reference in new issue
Block a user