Skip to content

Commit

Permalink
added appname attr which is required for the extjs model classname
Browse files Browse the repository at this point in the history
  • Loading branch information
abraxxa committed Dec 29, 2011
1 parent 8cc4157 commit 9a8a3e5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/DBICx/Generator/ExtJS/Model.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ DBICx::Generator::ExtJS::Model - ExtJS model producer
my $schema = My::Schema->connect;
my $generator = DBICx::Generator::ExtJS::Model->new(
schema => $schema,
schema => $schema,
appname => 'MyApp',
# this are the default args passed to JSON::DWIW->new
json_args => {
bare_keys => 1,
Expand Down Expand Up @@ -59,6 +60,12 @@ has 'schema' => (
required => 1,
);

has 'appname' => (
is => 'ro',
isa => 'Str',
required => 1,
);

has '_json' => (
is => 'ro',
isa => 'JSON::DWIW',
Expand Down Expand Up @@ -355,7 +362,9 @@ sub extjs_model_to_file {

my $json =
'Ext.define('
. $self->_json->to_json($extjs_model_name) . ', '
. $self->_json->to_json(
$self->appname . '.model.' . $extjs_model_name )
. ', '
. $self->_json->to_json($extjs_model_code) . ');';

my $file = $dir->file("$extjs_model_name.js");
Expand Down

0 comments on commit 9a8a3e5

Please sign in to comment.