This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise_for :users | |
devise_scope :user do | |
delete '/logout' => 'devise/sessions#destroy', as: :logout | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date Started: 09/04/2012 10:23:41 AM (GMT-05:00) | |
Date Completed: 09/04/2012 11:53:42 AM (GMT-05:00) | |
Grade/Score: 80% | |
Group Scores: | |
Code Questions - 91% | |
Appcelerator Cloud Services - 60% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date Started: 07/30/2012 7:28:21 PM (GMT-05:00) | |
Date Completed: 07/30/2012 8:58:09 PM (GMT-05:00) | |
Grade/Score: 68% | |
Group Scores: | |
Code Questions - 59% | |
Appcelerator Cloud Services - 60% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):016:0> 1 - 0.9 | |
=> 0.09999999999999998 | |
irb(main):017:0> 1 - 0.8 | |
=> 0.19999999999999996 | |
irb(main):018:0> 1 - 0.7 | |
=> 0.30000000000000004 | |
irb(main):019:0> 1 - 0.6 | |
=> 0.4 | |
irb(main):020:0> 1 - 0.5 | |
=> 0.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# lib/models/article.coffee | |
# => Resources/models/article.js | |
# | |
TiActiveRecord = require 'lib/TiActiveRecord' | |
class Article extends TiActiveRecord | |
@dbName = 'myapp' | |
@tableName = 'articles' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# lib/models/article.coffee | |
# => Resources/models/article.js | |
# | |
TiActiveRecord = require 'lib/TiActiveRecord' | |
class Article extends TiActiveRecord | |
@dbName = 'myapp' | |
@tableName = 'articles' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
articles = Article.all() | |
someUsersArticles = Article.find | |
user_id: 1 | |
someUsersArticles.length # => 3 | |
Article.deleteAll | |
user_id: 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a3 = Article.create | |
uid: 3 | |
title: 'Wonderful Article' | |
body: 'lorem ipsum...' | |
user_id: 3 | |
a3.isNewRecord() # => false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a2 = Article.find(1) | |
a2.id # => 1 | |
a2.uid # => 10 | |
a2.title # => 'Awesome Article' | |
a2.body # => 'Lorem Ipsum...' | |
a2.user_id # => 8 | |
a2.created_at # => 2012-08-20 20:20:20 | |
a2.updated_at # => 2012-08-20 20:20:20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1 = Article.build | |
uid: 10 | |
title: 'Awesome Article' | |
body: 'Lorem Ipsum...' | |
user_id: 8 | |
a1.isNewRecord() # => true | |
a1.save() |