I pushed an update last night to allow you to define Application.cfc
settings inside the config.ini using a "this" struct. Now, instead of
having "ormLogSQL = true" inside your config.ini, you can add
"this.ormSettings.logSQL = true" and it will copy the config settings
into the Application.cfc's "this" scope.
On Sep 13, 12:49 pm, Tony Nelson <
tonynelso...@gmail.com> wrote:
> Yeah they're not in the docs yet. Right now you can set the following ORM
> settings inside the config.ini.
>
> - ormDialect
> - ormDBCreate
> - ormLogSQL
> - ormSaveMapping
>
> I was thinking about changing the config.ini to better handle the
> Application.cfc settings rather than rely on magic keywords, but I haven't
> figured out the best approach yet. Maybe I'll end up keying off a "this"
> struct or something like this:
>
> [defaults]
> this.ormEnabled = true
> this.ormSettings.logSQL = true
> this.ormSettings.eventHander = coldmvc.app.util.EventHandler
>
> -Tony
>
>
>
>
>
>
>
> On Tue, Sep 13, 2011 at 12:44 PM, Dan Vega <
danv...@gmail.com> wrote:
> > ok that was it... i don't see these variables in the docs. Are you saying I
> > can setup all of my orm settings in the config ini?
>
> > Thank You
> > Dan Vega
> >
danv...@gmail.com
> >
http://www.danvega.org/
>
> > On Tue, Sep 13, 2011 at 1:27 PM, Tony Nelson <
tonynelso...@gmail.com>wrote:
>
> >> It looks like the DAO isn't being autowired into the Category model
> >> because the ColdMVC ORM event handler isn't specified inside your
> >> Application.cfc.
>
> >> You should be able to leave your Application.cfc empty and it should still
> >> work as expected using the default settings.
>
> >> If you don't want to use an empty Application.cfc, you could specify
> >> this.ormSettings.eventHandler = "coldmvc.app.util.EventHandler" and it
> >> should start working. However, I would just recommend using an empty
> >> Application.cfc. Most of the ORM settings are available via config settings
> >> if you need to customize a setting.
>
> >> -Tony
>
> >>>
danv...@gmail.com
> >>>
http://www.danvega.org/
>
> >>> On Tue, Sep 13, 2011 at 12:57 PM, Tony Nelson <
tonynelso...@gmail.com>wrote:
>
> >>>> Can you create a pastebin of your Application.cfc,
> >>>> CategoryController.cfc, and Category.cfc? Are you running the latest version
> >>>> of CF?
>
> >>>> -Tony
>
> >>>> On Tue, Sep 13, 2011 at 11:47 AM, Dan Vega <
danv...@gmail.com> wrote:
>
> >>>>> Thank You
> >>>>> Dan Vega
> >>>>>
danv...@gmail.com
> >>>>>
http://www.danvega.org/
>
> >>>>> On Tue, Sep 13, 2011 at 12:40 PM, Tony Nelson <
tonynelso...@gmail.com>wrote:
>
> >>>>>> Is the DAO listed inside the Beans section of the ColdMVC debug
> >>>>>> information?
>
> >>>>>> -Tony
>
> >>>>>> On Tue, Sep 13, 2011 at 11:39 AM, Dan Vega <
danv...@gmail.com> wrote:
>
> >>>>>>> it comes up as undefined
>
> >>>>>>> Thank You
> >>>>>>> Dan Vega
> >>>>>>>
danv...@gmail.com
> >>>>>>>
http://www.danvega.org/
>
> >>>>>>> On Tue, Sep 13, 2011 at 12:35 PM, Tony Nelson <
> >>>>>>>
tonynelso...@gmail.com> wrote:
>
> >>>>>>>> It looks like the DAO isn't being autowired into the model. Can you
> >>>>>>>> try calling category.getDAO() and seeing if it exists or not?
>
> >>>>>>>> -Tony
>
> >>>>>>>> On Tue, Sep 13, 2011 at 11:29 AM, Dan Vega <
danv...@gmail.com>wrote:
>
> >>>>>>>>> duh / yes it does, sorry! Ok I updated my example but now when I
> >>>>>>>>> save I am getting an error
>
> >>>>>>>>> public void function save(){
> >>>>>>>>> var category = _Category.get( params.category_id );
> >>>>>>>>> category.setName(
params.name);
> >>>>>>>>> category.setSort(params.sort);
> >>>>>>>>> var result = validationService.validate(category);
>
> >>>>>>>>> if( !result.hasErrors() ){
> >>>>>>>>> category.save();
> >>>>>>>>> flash.success = "Category Saved!";
> >>>>>>>>> redirect({action="list"});
> >>>>>>>>> } else {
> >>>>>>>>> // preserve some data on redirect
> >>>>>>>>> flash.errors = result.getErrorMessages();
> >>>>>>>>> flash.category = category;
> >>>>>>>>> redirect({action="edit"});
> >>>>>>>>> }
>
> >>>>>>>>> }
>
> >>>>>>>>> Variable DAO is undefined. The error occurred in *C:\www\coldmvc\Model.cfc:
> >>>>>>>>> line 173*
> >>>>>>>>> *Called from*C:\www\hyrule\samples\frameworks\coldmvc\app\controllers\CategoryController.cfc:
> >>>>>>>>> line 26
> >>>>>>>>> *Called from* : line 1
> >>>>>>>>> *Called from* C:\www\coldmvc\app\util\RouteDispatcher.cfc: line
> >>>>>>>>> 299
> >>>>>>>>> *Called from* C:\www\coldmvc\app\util\RouteDispatcher.cfc: line
> >>>>>>>>> 268
> >>>>>>>>> *Called from* C:\www\coldmvc\app\util\RouteDispatcher.cfc: line 72
> >>>>>>>>> *Called from* : line 1
> >>>>>>>>> *Called from* C:\www\coldmvc\app\util\EventDispatcher.cfc: line
> >>>>>>>>> 114
> >>>>>>>>> *Called from* C:\www\coldmvc\index.cfm: line 2
> >>>>>>>>> *Called from* C:\www\hyrule\samples\frameworks\coldmvc\public\index.cfm:
> >>>>>>>>> line 1
>
> >>>>>>>>> 171 : public any function save(boolean flush="true") {
> >>>>>>>>> 172 : *173 : return DAO.save(this, arguments.flush);*
> >>>>>>>>> 174 :
> >>>>>>>>> 175 : }
>
> >>>>>>>>> Thank You
>
> >>>>>>>>> Dan Vega
> >>>>>>>>>
danv...@gmail.com