Skip to content

Instantly share code, notes, and snippets.

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
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:
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:
<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>
|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"
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);
‣‣‣
<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>
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
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
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)