Skip to content

Commit

Permalink
Wrote a simple paginator for mongoid
Browse files Browse the repository at this point in the history
  • Loading branch information
mguinada committed Jul 25, 2012
1 parent 46e8827 commit f93fffe
Show file tree
Hide file tree
Showing 21 changed files with 278 additions and 449 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,3 +13,4 @@ log/*.log
tmp/**/*
tmp/
chromedriver.log
capybara-*.html
6 changes: 5 additions & 1 deletion Gemfile
Expand Up @@ -10,12 +10,16 @@ gem 'bcrypt-ruby', '~> 3.0.0', require: 'bcrypt'
gem 'haml', '~> 3.1.0'
gem 'tux'
gem 'rack-conneg', '~> 0.1.0'
gem 'escape_utils', '~> 0.2.0'

group :development do
gem 'shotgun'
end

group :test do
gem 'rspec', '~> 2.11.0'
gem 'valid_attribute', '~> 1.2.0'
gem 'capybara', '~> 1.1.0'
gem 'launchy', '~> 2.1.0'
gem 'selenium-webdriver', '~> 2.24.0'
gem 'capybara-webkit', '~> 0.12.0'
end
10 changes: 5 additions & 5 deletions Gemfile.lock
Expand Up @@ -21,16 +21,13 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
capybara-webkit (0.12.1)
capybara (>= 1.0.0, < 1.2)
json
childprocess (0.3.3)
ffi (~> 1.0.6)
diff-lcs (1.1.3)
escape_utils (0.2.4)
ffi (1.0.11)
haml (3.1.6)
i18n (0.6.0)
json (1.7.3)
launchy (2.1.0)
addressable (~> 2.2.6)
libwebsocket (0.1.4)
Expand Down Expand Up @@ -77,6 +74,8 @@ GEM
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
shotgun (0.9)
rack (>= 1.0)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
Expand All @@ -101,7 +100,7 @@ DEPENDENCIES
bcrypt-ruby (~> 3.0.0)
bson_ext (~> 1.6.0)
capybara (~> 1.1.0)
capybara-webkit (~> 0.12.0)
escape_utils (~> 0.2.0)
haml (~> 3.1.0)
launchy (~> 2.1.0)
mongoid (~> 3.0.0)
Expand All @@ -110,6 +109,7 @@ DEPENDENCIES
rack-flash3 (~> 1.0.0)
rspec (~> 2.11.0)
selenium-webdriver (~> 2.24.0)
shotgun
sinatra (~> 1.3.0)
tux
valid_attribute (~> 1.2.0)
Expand Down
8 changes: 4 additions & 4 deletions Rakefile
Expand Up @@ -32,19 +32,19 @@ namespace :db do
users << User.create!(email: "user#{i}@example.com", password: "password")
end

num_refs = 15
refs_per_user = 50
links = []
1.upto num_refs do |i|
1.upto refs_per_user do |i|
links << Link.create!(url: "link#{i}.example.org")
end

refs = []
users.each do |user|
1.upto num_refs do |i|
1.upto refs_per_user do |i|
refs << Reference.create!(link: links[i - 1],
user: user,
title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vehicula, leo nec aliquet lobortis",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vehicula, leo nec aliquet lobortis")
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vehicula, leo nec aliquet lobortis")
end
end
puts "Finished!"
Expand Down
82 changes: 0 additions & 82 deletions capybara-201207141514031385973211.html

This file was deleted.

82 changes: 0 additions & 82 deletions capybara-201207141515427745138779.html

This file was deleted.

82 changes: 0 additions & 82 deletions capybara-20120714151715367072263.html

This file was deleted.

0 comments on commit f93fffe

Please sign in to comment.