Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Minor Changes #202

Closed
wants to merge 15 commits into from

4 participants

Miguel Madero Daniel Erickson Larz Conwell Matthew Eernisse
Miguel Madero

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

Miguel Madero MiguelMadero referenced this pull request
Merged

Updated Tutorial #203

Daniel Erickson
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]])

Daniel Erickson
Owner

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

Larz Conwell

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.

Miguel Madero

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!).

Larz Conwell

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

Miguel Madero

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

Larz Conwell

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. Miguel Madero

    Added TODO

    MiguelMadero authored
  2. Miguel Madero

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

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

    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. Miguel Madero
  5. Miguel Madero
Commits on Sep 30, 2012
  1. Miguel Madero
  2. Miguel Madero
Commits on Oct 1, 2012
  1. Miguel Madero
  2. Miguel Madero

    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. Miguel Madero
  2. Miguel Madero
  3. Miguel Madero
Commits on Oct 5, 2012
  1. Miguel Madero

    merge

    MiguelMadero authored
Commits on Oct 6, 2012
  1. Miguel Madero
Commits on Oct 9, 2012
  1. Miguel Madero
This page is out of date. Refresh to see the latest.
4 Makefile
View
@@ -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
3  bin/cli.js
View
@@ -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'
3  lib/model/index.js
View
@@ -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);
};
};
12 lib/template/helpers/utils.js
View
@@ -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] ?
5 templates/scaffold/model.ejs
View
@@ -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.