lib/avo/base_action.rb in avo-2.8.0 vs lib/avo/base_action.rb in avo-2.9.0
- old
+ new
@@ -118,12 +118,17 @@
self
end
def visible_in_view
- return true unless visible.present?
+ # Run the visible block if available
+ return instance_exec(resource: self.class.resource, view: view, &visible) if visible.present?
- instance_exec(resource: self.class.resource, view: view, &visible)
+ # Hide on the :new view by default
+ return false if view == :new
+
+ # Show on all other views
+ true
end
def param_id
self.class.to_s.demodulize.underscore.tr "/", "_"
end