From 1c311d64f260430ee33bc8aeda03aeb5f437d9a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 16 Apr 2015 14:19:30 +0200 Subject: [PATCH] PriceSource: Implementoren zwischen price/discount cachen. --- SL/PriceSource.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/PriceSource.pm b/SL/PriceSource.pm index 7ca287ded..c8cdc6cd1 100644 --- a/SL/PriceSource.pm +++ b/SL/PriceSource.pm @@ -4,6 +4,7 @@ use strict; use parent 'SL::DB::Object'; use Rose::Object::MakeMethods::Generic ( scalar => [ qw(record_item record) ], + 'array --get_set_init' => [ qw(all_price_sources) ], ); use List::UtilsBy qw(min_by max_by); @@ -11,12 +12,12 @@ use SL::PriceSource::ALL; use SL::PriceSource::Price; use SL::Locale::String; -sub all_price_sources { +sub init_all_price_sources { my ($self) = @_; - map { + [ map { $_->new(record_item => $self->record_item, record => $self->record) - } SL::PriceSource::ALL->all_enabled_price_sources + } SL::PriceSource::ALL->all_enabled_price_sources ] } sub price_from_source { -- 2.20.1