Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Minor Changes #202

Closed
wants to merge 15 commits into from

4 participants

@MiguelMadero

While I was doing the tutorial I did a few minor changes that weren't completely related or needed by the tutorial.

@MiguelMadero MiguelMadero referenced this pull request
Merged

Updated Tutorial #203

@Techwraith
Owner

I think we need this one for the SQL adapters, not sure though @mde?

Owner

Yes, we need to assume people want auto-increment when using SQL. How is it crashing?

I can't reproduce it. Not sure what the issue was or if there was something else that fixed it :(
I guess I should've documented this better a lot of this issues came from notes when I was playing around.

That said, while trying to reproduce this I found another issue. The int property is created as an integer which causes a validation error ([[model.validatesInteger]])

@Techwraith
Owner

@MiguelMadero @mde @larzconwell What's going on with this pull request, can it be merged? Should it be merged? Has it been merged?

@larzconwell

Woah that commit list! haha If we do merge it, the deletions in templates/scaffold/model.ejs shouldn't be deleted. Also I'm not convinced we should add a quickinstall rule to the Makefile.

@MiguelMadero

I just went through all of the commits and this is probably the only useful one.
MiguelMadero@97742e7

The select content tag helper works nice, but I want do add some extra features, so I'll send a separate pull request.

Re: quickinstall. I just wanted a quick way to install it locally without waiting for all the updates, but I should stop using quickinstall or even install and just create a link to the cli in my repo (doh!).

@larzconwell

@MiguelMadero I went ahead and pushed that change you made with the help dialog so I'm going to close this. Commit was 62886dd

@MiguelMadero

Thanks. I created an issue to change the contentTag helper to support select tags.

@larzconwell

Yeah I was just about to comment on there haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 29, 2012
  1. @MiguelMadero

    Added TODO

    MiguelMadero authored
  2. @MiguelMadero

    Makes the model generator behave the same when using resource or scaf…

    MiguelMadero authored
    …fold (it sets autoincrement for int ids)
  3. @MiguelMadero

    Adds a quick task option that doesn't update the dependencies. Useful…

    MiguelMadero authored
    … when working offline or you simply don't want to wait for NPM.
  4. @MiguelMadero
  5. @MiguelMadero
Commits on Sep 30, 2012
  1. @MiguelMadero
  2. @MiguelMadero
Commits on Oct 1, 2012
  1. @MiguelMadero
  2. @MiguelMadero

    This is crashing when using the memory adapter, not sure if it's need…

    MiguelMadero authored
    …ed or not, it doesn't seem affect mono if we don't have it and might not need to be the default
Commits on Oct 3, 2012
  1. @MiguelMadero
  2. @MiguelMadero
  3. @MiguelMadero
Commits on Oct 5, 2012
  1. @MiguelMadero

    merge

    MiguelMadero authored
Commits on Oct 6, 2012
  1. @MiguelMadero
Commits on Oct 9, 2012
  1. @MiguelMadero
This page is out of date. Refresh to see the latest.
View
4 Makefile
@@ -37,11 +37,11 @@ install:
quickinstall:
@mkdir -p $(DESTDIR)$(PREFIX)/bin && \
- mkdir -p $(DESTDIR)$(PREFIX)/lib/node_modules/geddy && \
+ mkdir -p $(DESTDIR)$(PREFIX)/lib/node_modules/geddy && \
cp -R ./* $(DESTDIR)$(PREFIX)/lib/node_modules/geddy/ && \
ln -snf ../lib/node_modules/geddy/bin/cli.js $(DESTDIR)$(PREFIX)/bin/geddy && \
chmod 755 $(DESTDIR)$(PREFIX)/lib/node_modules/geddy/bin/cli.js && \
- echo 'Geddy installed.'
+ echo 'Geddy installed. Geddy dependencies might need to be updated. Use install instead of quick-install to make sure everything is up to date'
clean:
@true
View
3  bin/cli.js
@@ -56,9 +56,10 @@ usage = [
, ' the views, a model, controller and route'
, ' secret Generate a new application secret in'
, ' `congig/environment`'
- , ' controller <name> Generate a new controller including an index view'
+ , ' controller <name> Generate a new controller including an index view'
, ' and and a route'
, ' model <name> [attrs] Generate a new model'
+ , ' console Opens a geddy console'
, ''
, 'Examples:'
, ' geddy Start Geddy on localhost:4000 in development mode'
View
3  lib/model/index.js
@@ -211,6 +211,9 @@ utils.mixin(model, new (function () {
throw new Error('geddy.model.adapter is not defined.');
}
adapt = model.adapter[name];
+ // TODO: Miguel. I think this should be:
+ // adapt.apply(model.adapter, arguments);
+ // TODO: Miguel. Is this missing tests?
return adapt[method].apply(adapt, arguments);
};
};
View
12 lib/template/helpers/utils.js
@@ -51,7 +51,8 @@ exports.tags = {
htmlOptions = htmlOptions || {};
var selfClosing = (tag in this.selfClosingTags) ? this.selfClosingTags[tag] : undefined
- , tagOptions;
+ , tagOptions
+ , i;
if (selfClosing) {
htmlOptions[selfClosing.content] = htmlOptions[selfClosing.content] || content || false;
@@ -62,6 +63,15 @@ exports.tags = {
if (tag === 'img') {
htmlOptions.alt = htmlOptions.alt === '' ? htmlOptions.alt : htmlOptions.alt || content;
}
+ if(tag === 'select') {
+ if(content === '' && htmlOptions.options){
+ for (i in htmlOptions.options) {
+ content += '<option>'+htmlOptions.options[i]+'</option>';
+ }
+ htmlOptions.options = undefined;
+ }
+ }
+
tagOptions = this.tagOptions(htmlOptions);
content = this.preContentStrings[tag] ?
View
5 templates/scaffold/model.ejs
@@ -12,11 +12,6 @@ var <%= names.constructor.singular %> = function () {
<% } -%>
});
-<% for(var i in properties) { -%>
-<% if(properties[i].name === 'id' && properties[i].type === 'int') { -%>
- this.autoIncrementId = true;
-<% } -%>
-<% } -%>
/*
this.property('login', 'string', {required: true});
Something went wrong with that request. Please try again.