Skip to content

Commit

Permalink
Work without ActiveStorage
Browse files Browse the repository at this point in the history
if ActiveStorage is not included, then we see the error uninitialized constant Avo::Fields::Common::Files::ControlsComponent::ActiveStorage
  • Loading branch information
jpawlyn committed Sep 3, 2024
1 parent 69f0cd7 commit e677e81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Avo::Fields::Common::Files::ControlsComponent < Avo::BaseComponent
delegate :id, to: :@field

prop :field, Avo::Fields::BaseField
prop :file, ActiveStorage::Attachment
prop :file, ActiveStorage::Attachment if defined?(ActiveStorage::Attachment)
prop :resource, Avo::BaseResource

def destroy_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Avo::Fields::Common::Files::ViewType::GridItemComponent < Avo::BaseComponent
prop :field, Avo::Fields::BaseField
prop :resource, Avo::BaseResource
prop :file, _Nilable(ActiveStorage::Attachment)
prop :file, _Nilable(ActiveStorage::Attachment) if defined?(ActiveStorage::Attachment)
prop :extra_classes, _Nilable(String)

def id
Expand Down

0 comments on commit e677e81

Please sign in to comment.