This file contains 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
def matches_dsl | |
if(self.gender_id == 1 && orientation_id == 1) then | |
[[2,1],[2,3]] | |
elsif(self.gender_id == 1 && orientation_id == 2) then | |
[[1,2],[1,3]] | |
elsif(self.gender_id == 1 && orientation_id == 3) then | |
[[1,2],[1,3],[2,1],[2,3]] | |
elsif(self.gender_id == 2 && orientation_id == 1) then | |
[[1,1],[1,3]] | |
elsif(self.gender_id == 2 && orientation_id == 2) then |
This file contains 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
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. | |
john@john-XPS-M1330:/var/www/mainapp$ rails g devape_cms | |
generate devise:install | |
create config/initializers/devise.rb | |
create config/locales/devise.en.yml | |
=============================================================================== | |
Some setup you must do manually if you haven't yet: |
This file contains 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
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. | |
john@john-XPS-M1330:/var/www/mainapp$ rails g devape_cms | |
generate devise:install | |
create config/initializers/devise.rb | |
create config/locales/devise.en.yml | |
=============================================================================== | |
Some setup you must do manually if you haven't yet: |
This file contains 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
<VirtualHost *> | |
ServerAdmin webmaster@localhost | |
ServerName dating.knockout.dontexit.org | |
ServerAlias dating.knockout.dontexist.org | |
DocumentRoot /srv/rails/dating/current | |
<Directory /srv/rails/dating/current/public> | |
Options FollowSymLinks | |
AllowOverride All‣ | |
</Directory> |
This file contains 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
|Blog.Views.Posts ||= {} | |
| | |
|class Blog.Views.Posts.PostView extends Backbone.View | |
| template: JST["backbone/templates/posts/post"] | |
| | |
| events: | |
| "click .destroy" : "destroy" | |
| "click .edit-post" : "edit" | |
| | |
| tagName: "tr" |
This file contains 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
NewDate.Views.Profiles ||= {} | |
class NewDate.Views.Profiles.IndexView extends Backbone.View | |
template: JST["backbone/templates/profiles/index"] | |
‣‣‣‣ | |
initialize: () -> | |
_.bindAll(this, 'addOne', 'addAll', 'render'); | |
‣‣‣‣ | |
@options.profiles.bind('reset', this.addAll); | |
‣‣‣ |
This file contains 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
<VirtualHost *> | |
ServerAdmin webmaster@localhost | |
ServerName loki.knockout.dontexist.org | |
DocumentRoot /srv/rails/loki/current | |
<Directory /srv/rails/loki/current/public> | |
Options FollowSymLinks | |
AllowOverride All | |
</Directory> |
This file contains 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
def all_children(x=1) | |
all = [] | |
self.children.each do |f| | |
all << f | |
root_children = f.all_children(x).flatten | |
all << root_children unless root_children.empty? | |
end | |
return all.flatten | |
end |
This file contains 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
def all_children(x=1) | |
all = [] | |
self.children.each do |f| | |
all << f | |
if x < 3 then | |
root_children = f.all_children(x).flatten | |
all << root_children unless root_children.empty? | |
x = x + 1 | |
end | |
end |
This file contains 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
require 'spec_helper' | |
describe Member do | |
it "should authenticate with matching username and password" do | |
user = Factory(:member) | |
Member.find_by_email('foo1@example.com').should == user | |
end | |
describe "references" do | |
before(:each) do | |
@user = Factory(:member) | |
@user_two = Factory(:member, :parent_id=>@user.id) |