lib/amee/profile_api/profile_item.rb in hookercookerman-amee-0.0.7 vs lib/amee/profile_api/profile_item.rb in hookercookerman-amee-0.0.8

- old
+ new

@@ -4,11 +4,12 @@ module ProfileApi class ProfileItem include Amee::Model self.path_prefix = "/profiles" - attr_accessor :end, :amount, :data_item, :profile, :valid_from, :start_date, :end_date, :amount_per_month, :total_amount + attr_accessor :end, :amount, :data_item, :profile, :valid_from, :start_date, :end_date + attr_accessor :data_item_label, :data_item_uid, :amount_per_month, :total_amount list_populators :item_values => {:class => Amee::DataApi::DataItemValue} item_populators :data_category => {:class => Amee::DataApi::DataCategory}, :item_definition => {:class => Amee::DataApi::ItemDefinition} @@ -40,12 +41,14 @@ def full_path "#{self.class.path_prefix}/#{profile_uid}" + resource_path end - # its be default already totally loaded - def lazy_loaded - true + def populate! + session.api_call(:get, "profile_item", self.full_path) do |response| + populate_from_hash!(response) + end + @lazy_loaded = true end end end end \ No newline at end of file