WARNING!    IAMAEE  (I Am Not An Erlang Expert)  what follows is based on
long hours of debugging similar issues in CB (not through long and
thoughtful studies of CB internals) and may be inaccurate, inefficient or
at least wildly wrong.

With that out of the way, I THINK what is happening is the following:

'apply' here is the erlang BIF (
http://www.erlang.org/doc/man/erlang.html#apply-2)

It is being used to evaluate the call because the Master variable has not
been recognised as a CB model.

The output from the module_info function shows that it has been compiled
correctly (attributes, set, etc functions are present) so the remaining
possibility that I have personally encountered is that the erlang record is
the wrong length. However, looking at the model code originally provided

     -module(master, [Id, Name, Address, Description]).
     -compile(export_all).

and the record provided in the error message:

     {master,"master-1",<<"my name field">>,<<"this is address
field">>,<<"description field">>},

things seem to line up fine

So the only thing I can see that is 'odd' in my experience is the values in
the fields. I always use string values, which may have been an original
constraint of CB. If it was, it certainly has been relaxed now, the
documentation clearly says binaries are allowed. Maybe someone with
experience in PostgreSQL/CB may be able to correct me (I use Mnesia only)
but it may be worth trying the same thing with the record:

     {master,"master-1","my name field","this is address
field","description field"}

and see what happens. Possibly you need to have typing info in the model
for it to work with PostgreSQL?

(Yes, I am clutching at straws here a bit, but I seem to have lost my boat
:-( )

g



On 13 May 2014 22:11, can2nac <[email protected]> wrote:

> also give a full error log as it is not clear in which nodule "apply" is
> then one can check that module, check apply function and figure out why
> exception was given
>
> @@
> "exception error: bad argument
>      in function  apply/3
>         called as apply([{master,"master-1",<<"my name field">>,<<"this
> is address field">>,
>                                  <<"description field">>}],
>                         id,[])
> @@
>
> On Tuesday, May 13, 2014 7:07:46 PM UTC+4, can2nac wrote:
>>
>> attach actual model file, do not paste content
>>
>> On Tuesday, May 13, 2014 4:35:06 PM UTC+4, rastin rastini wrote:
>>>
>>> my CB version is 0.8.7.
>>>
>>> when is run command "master:module_info(exports)." then get this out put:
>>>
>>> "
>>> [{attribute_names,1},
>>>  {attribute_types,1},
>>>  {database_columns,1},
>>>  {database_table,1},
>>>  {validate_types,1},
>>>  {validate,1},
>>>  {save,1},
>>>  {set,2},
>>>  {set,3},
>>>  {attributes,1},
>>>  {belongs_to_names,1},
>>>  {belongs_to_types,1},
>>>  {belongs_to,1},
>>>  {id,1},
>>>  {name,1},
>>>  {address,1},
>>>  {description,1},
>>>  {get,2},
>>>  {new,4},
>>>  {instance,4},
>>>  {module_info,0},
>>>  {module_info,1}]
>>>
>>> "
>>>
>>  --
> 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/322eeac1-7296-496a-93da-0a1783597208%40googlegroups.com<https://groups.google.com/d/msgid/chicagoboss/322eeac1-7296-496a-93da-0a1783597208%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/CAKF5fiBhPr-xgQ8hpmojh_wXMG0CA1gJY%3D_KmNWRFzq%3D35u2fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to