We forgot to change the line rendering the image in commits3574bf867cand810bdae37a, and so the custom image was being ignored. Note that, in the test, we're stubbing a constant instead of adding a new image. The main reason is that, if we add a new image, forks would have to change the image when they change the `VALID_IMAGES` constant; otherwise the tests would fail.
16 lines
374 B
Ruby
16 lines
374 B
Ruby
class Budgets::Executions::ImageComponent < ApplicationComponent
|
|
attr_reader :investment
|
|
delegate :image_path_for, to: :helpers
|
|
|
|
def initialize(investment)
|
|
@investment = investment
|
|
end
|
|
|
|
private
|
|
|
|
def milestone
|
|
investment.milestones.order_by_publication_date
|
|
.select { |milestone| milestone.image.present? }.last
|
|
end
|
|
end
|