There the problem. find returns a list of elements, not a single element.
So Master1 is a list of elements.

Do

[Master1] = boss_db:find(master, [{id, 'equals', "master-1"}]).

Then your attributes call should work.

-Jesse

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm
On May 13, 2014 10:46 AM, "rastin rastini" <[email protected]> wrote:

> model file is attached.
>
> this is an work flow:
>
> 1>boss_db:find(master, []).
> [{master,"master-1",<<"naja">>,<<"tehran">>,
>          <<"naja master">>},
>  {master,"master-2",<<"artesh">>,<<"tehran">>,
>          <<"artesh master">>}]
>
>
> 2> Master1= boss_db:find(master, [{id, 'equals', "master-1"}]).
> [{master,"master-1",<<"naja">>,<<"tehran">>,
>          <<"naja master">>}]
>
> 3> Master1:attributes().
> ** exception error: bad argument
>      in function  apply/3
>         called as apply([{master,"master-1",<<"naja">>,<<"tehran">>,
>                                  <<"naja master">>}],
>                         attributes,[])
>
>  --
> You received this message because you are subscribed to the Google Groups
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chicagoboss/d8a4891c-c59e-431c-a7fc-712f68572a03%40googlegroups.com<https://groups.google.com/d/msgid/chicagoboss/d8a4891c-c59e-431c-a7fc-712f68572a03%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/chicagoboss/CAPTXyXc%3DyEKvGfXcH5RJSMBFkhpqDeqsPdLavMpFK7dY7CNgZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to