lib/iugusdk/controllers/helpers.rb in iugusdk-1.0.0.alpha.2 vs lib/iugusdk/controllers/helpers.rb in iugusdk-1.0.0.alpha.3

- old
+ new

@@ -10,9 +10,13 @@ def current_user_account @current_user_account ||= search_user_account( session[:current_account_id] ) end + def current_account + current_user_account.try(:account) + end + def set_account( resource, account_id=nil ) if account_id == nil account_id = cookies[:last_used_account_id] if cookies[:last_used_account_id] end selected_account = resource.default_account( account_id )