Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into logos

  • Loading branch information...
commit 53f30910e90d91a3ebef14f5a1bd8213c9abe682 2 parents 5662703 + b108416
@game7 authored
View
9 Gemfile
@@ -5,7 +5,7 @@ gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem 'mongoid', '~> 3.0.0'
+gem 'mongoid', '~> 3.1.0'
gem 'bson_ext'
gem 'mongoid-tree', :require => 'mongoid/tree'
gem 'mongoid_taggable', :git => 'git://github.com/game7/mongoid_taggable.git'
@@ -20,16 +20,15 @@ gem 'icalendar'
gem 'chronic'
#gem 'formtastic', '~> 1.2.3'
-gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'
+gem 'simple_form', '~> 2.0.4'
#gem 'delayed_job'
-gem "carrierwave-mongoid", :git => "git://github.com/jnicklas/carrierwave-mongoid.git", :branch => "mongoid-3.0"
+gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
gem 'fog'
gem 'rmagick'
-gem 'remotipart', '~> 0.4'
+gem 'remotipart', '~> 1.0'
-#gem "wymeditor-rails", :git => 'git://github.com/game7/wymeditor-rails.git'
gem "RedCloth"
View
170 Gemfile.lock
@@ -4,29 +4,11 @@ GIT
specs:
mongoid_taggable (0.1.7.1)
-GIT
- remote: git://github.com/jnicklas/carrierwave-mongoid.git
- revision: fb61fb90a9512618ec21e13ad823485933e6293b
- branch: mongoid-3.0
- specs:
- carrierwave-mongoid (0.3.0.alpha)
- carrierwave (~> 0.6)
- mongoid (~> 3.0.0)
- mongoid-grid_fs (~> 1.3.1)
-
-GIT
- remote: git://github.com/plataformatec/simple_form.git
- revision: b886877fc2320593180a55fb2880fcb07d4d3315
- specs:
- simple_form (2.1.0.dev)
- actionpack (~> 3.0)
- activemodel (~> 3.0)
-
GEM
remote: http://rubygems.org/
specs:
RedCloth (4.2.9)
- ZenTest (4.8.3)
+ ZenTest (4.9.0)
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
@@ -54,7 +36,7 @@ GEM
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
- addressable (2.2.8)
+ addressable (2.3.3)
arel (3.0.2)
autotest (4.4.6)
ZenTest (>= 4.4.1)
@@ -64,9 +46,9 @@ GEM
ZenTest (~> 4.5)
autotest-standalone (4.5.11)
bcrypt-ruby (3.0.1)
- bson (1.8.1)
- bson_ext (1.8.1)
- bson (~> 1.8.1)
+ bson (1.8.2)
+ bson_ext (1.8.2)
+ bson (~> 1.8.2)
builder (3.0.4)
capybara (2.0.2)
mime-types (>= 1.16)
@@ -78,8 +60,12 @@ GEM
carrierwave (0.8.0)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
- childprocess (0.3.6)
- ffi (~> 1.0, >= 1.0.6)
+ carrierwave-mongoid (0.5.0)
+ carrierwave (~> 0.8.0)
+ mongoid (~> 3.0)
+ mongoid-grid_fs (~> 1.3)
+ childprocess (0.3.8)
+ ffi (~> 1.0, >= 1.0.11)
chronic (0.9.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
@@ -89,70 +75,68 @@ GEM
execjs
coffee-script-source (1.4.0)
commonjs (0.2.6)
- devise (2.2.0)
+ devise (2.2.3)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.2.1)
diff-lcs (1.1.3)
erubis (2.7.0)
- excon (0.6.6)
+ excon (0.18.5)
execjs (1.4.0)
multi_json (~> 1.0)
- factory_girl (4.1.0)
+ factory_girl (4.2.0)
activesupport (>= 3.0.0)
- factory_girl_rails (4.1.0)
- factory_girl (~> 4.1.0)
+ factory_girl_rails (4.2.1)
+ factory_girl (~> 4.2.0)
railties (>= 3.0.0)
faker (1.1.2)
i18n (~> 0.5)
- faraday (0.6.1)
- addressable (~> 2.2.4)
- multipart-post (~> 1.1.0)
- rack (>= 1.1.0, < 2)
- ffi (1.3.0)
- fog (0.9.0)
+ faraday (0.7.6)
+ addressable (~> 2.2)
+ multipart-post (~> 1.1)
+ rack (~> 1.1)
+ ffi (1.4.0)
+ fog (1.9.0)
builder
- excon (~> 0.6.1)
- formatador (>= 0.1.3)
- json
+ excon (~> 0.14)
+ formatador (~> 0.2.0)
mime-types
- net-scp (>= 1.0.4)
- net-ssh (>= 2.1.4)
- nokogiri (>= 1.4.4)
+ multi_json (~> 1.0)
+ net-scp (~> 1.0.4)
+ net-ssh (>= 2.1.3)
+ nokogiri (~> 1.5.0)
ruby-hmac
formatador (0.2.4)
- haml (3.1.7)
- haml-rails (0.3.5)
+ haml (4.0.0)
+ tilt
+ haml-rails (0.4)
actionpack (>= 3.1, < 4.1)
activesupport (>= 3.1, < 4.1)
- haml (~> 3.1)
+ haml (>= 3.1, < 4.1)
railties (>= 3.1, < 4.1)
hashie (1.2.0)
hike (1.2.1)
i18n (0.6.1)
- icalendar (1.2.1)
+ icalendar (1.2.2)
journey (1.0.4)
- jquery-rails (2.1.4)
+ jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
- json (1.7.6)
+ json (1.7.7)
kaminari (0.14.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
- launchy (2.1.0)
- addressable (~> 2.2.6)
+ launchy (2.2.0)
+ addressable (~> 2.3)
less (2.2.2)
commonjs (~> 0.2.6)
less-rails (2.2.6)
actionpack (>= 3.1)
less (~> 2.2.0)
- less-rails-bootstrap (2.2.0)
+ less-rails-bootstrap (2.2.1)
less-rails (~> 2.2.0)
libv8 (3.11.8.13)
- libwebsocket (0.1.7.1)
- addressable
- websocket
machinist (1.0.6)
machinist_mongo (1.2.0)
machinist (~> 1.0.6)
@@ -160,47 +144,48 @@ GEM
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.19)
- mongoid (3.0.16)
- activemodel (~> 3.1)
- moped (~> 1.1)
+ mime-types (1.21)
+ mongoid (3.1.1)
+ activemodel (~> 3.2)
+ moped (~> 1.4.2)
origin (~> 1.0)
tzinfo (~> 0.3.22)
- mongoid-grid_fs (1.3.3)
+ mongoid-grid_fs (1.7.0)
mime-types (~> 1.19)
mongoid (~> 3.0)
mongoid-tree (1.0.1)
mongoid (>= 3.0, <= 4.0)
- moped (1.3.2)
- multi_json (1.5.0)
+ moped (1.4.2)
+ multi_json (1.0.4)
+ multi_xml (0.4.4)
multipart-post (1.1.5)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
- net-ssh (2.6.2)
+ net-ssh (2.6.5)
nifty-generators (0.4.6)
- nokogiri (1.4.7)
- oa-core (0.2.4)
- oa-oauth (0.2.4)
- faraday (~> 0.6.1)
- multi_json (>= 0.0.5)
- nokogiri (~> 1.4.2)
- oa-core (= 0.2.4)
+ nokogiri (1.5.6)
+ oa-core (0.3.2)
+ oa-oauth (0.3.2)
+ faraday (~> 0.7.3)
+ multi_json (~> 1.0.0)
+ multi_xml (~> 0.4.0)
+ oa-core (= 0.3.2)
oauth (~> 0.4.0)
- oauth2 (~> 0.4.1)
+ oauth2 (~> 0.5.0)
oauth (0.4.7)
- oauth2 (0.4.1)
- faraday (~> 0.6.1)
- multi_json (>= 0.0.5)
- omniauth (1.1.1)
+ oauth2 (0.5.2)
+ faraday (~> 0.7)
+ multi_json (~> 1.0)
+ omniauth (1.1.3)
hashie (~> 1.2)
rack
origin (1.0.11)
orm_adapter (0.4.0)
polyglot (0.3.3)
- rack (1.4.3)
+ rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
- rack-ssl (1.3.2)
+ rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
@@ -220,7 +205,7 @@ GEM
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (10.0.3)
- rdoc (3.12)
+ rdoc (3.12.1)
json (~> 1.4)
ref (1.0.2)
remarkable (4.0.0.alpha4)
@@ -230,8 +215,8 @@ GEM
rspec (>= 2.0.0.alpha11)
remarkable_mongoid (0.6.0)
remarkable_activemodel (~> 4.0.0.alpha4)
- remotipart (0.4.2)
- rmagick (2.13.1)
+ remotipart (1.0.5)
+ rmagick (2.13.2)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
@@ -239,8 +224,8 @@ GEM
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
- rspec-mocks (2.12.1)
- rspec-rails (2.12.1)
+ rspec-mocks (2.12.2)
+ rspec-rails (2.12.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
@@ -250,21 +235,24 @@ GEM
ruby-hmac (0.4.0)
rubyzip (0.9.9)
sass (3.2.5)
- sass-rails (3.2.5)
+ sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
- selenium-webdriver (2.27.2)
+ selenium-webdriver (2.30.0)
childprocess (>= 0.2.5)
- libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
+ websocket (~> 1.0.4)
+ simple_form (2.0.4)
+ actionpack (~> 3.0)
+ activemodel (~> 3.0)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- therubyracer (0.11.1)
- libv8 (~> 3.11.8.7)
+ therubyracer (0.11.3)
+ libv8 (~> 3.11.8.12)
ref
thor (0.14.6)
tilt (1.3.3)
@@ -281,7 +269,7 @@ GEM
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
- websocket (1.0.6)
+ websocket (1.0.7)
xpath (1.0.0)
nokogiri (~> 1.3)
@@ -295,7 +283,7 @@ DEPENDENCIES
autotest-rails
bson_ext
capybara
- carrierwave-mongoid!
+ carrierwave-mongoid
chronic
coffee-rails (~> 3.2.0)
devise
@@ -310,7 +298,7 @@ DEPENDENCIES
launchy
less-rails-bootstrap (>= 2.2.0)
machinist_mongo
- mongoid (~> 3.0.0)
+ mongoid (~> 3.1.0)
mongoid-tree
mongoid_taggable!
nifty-generators
@@ -318,12 +306,12 @@ DEPENDENCIES
omniauth
rails (= 3.2.1)
remarkable_mongoid (>= 0.5.0)
- remotipart (~> 0.4)
+ remotipart (~> 1.0)
rmagick
rspec (>= 2.0.1)
rspec-rails (>= 2.0.1)
sass-rails (~> 3.2.0)
- simple_form!
+ simple_form (~> 2.0.4)
therubyracer
uglifier
webrat
View
3  app/assets/javascripts/application.js
@@ -1,7 +1,6 @@
//= require jquery
//= require jquery_ujs
//= require jquery-ui.min
-//= require jquery.form
//= require jquery.remotipart
//= require twitter/bootstrap
//= require jcrop/jquery.Jcrop.min
@@ -40,7 +39,7 @@ $(document).ready(function() {
window.location = this.value;
});
- $('.toggle').live("click", function() {
+ $('.toggle').on("click", function() {
$('#'+this.getAttribute('rel')).slideToggle(300);
return false;
});
View
4 app/assets/javascripts/pages.js
@@ -83,8 +83,8 @@ $(function() {
updateBlockPositions($origin);
updateBlockPositions($target);
return false;
- });
-
+ });
+
$(document).on('click', '.section a.add_block', function(){
$('#column').val( $(this).attr('data-column') );
$('#section_id').val( $(this).attr('data-section_id') );
View
2  app/models/block.rb
@@ -6,7 +6,7 @@ class Block
field :section_id, :type => BSON::ObjectId
field :column, :default => 0, :type => Integer
- field :position, :type => Integer
+ field :position, :type => Integer, :default => 0
embedded_in :page
View
2  app/models/hockey/player.rb
@@ -14,7 +14,7 @@ def name
"#{first_name} #{last_name}"
end
- belongs_to :player
+ belongs_to :player, class_name: "::Player"
embedded_in :statsheet, :class_name => "Hockey::Statsheet"
scope :with_num, ->(n) { where(num: n) }
View
2  app/models/hockey/statsheet.rb
@@ -248,6 +248,7 @@ def event_deleted(event)
end
def goal_created(goal)
+ puts "GOAL!"
increment_goals_for_player(goal.side, goal.plr, 1)
increment_assists_for_player(goal.side, goal.a1, 1)
increment_assists_for_player(goal.side, goal.a2, 1)
@@ -341,6 +342,7 @@ def calculate_player_stats
end
def clear_player_stats
+ puts '*****************************'
players.each do |plr|
plr.clear_stats
plr.gp = 1 if plr.played
View
6 app/models/hockey/statsheet/processor.rb
@@ -32,7 +32,9 @@ def self.update_player_stats statsheet
def self.post_player_results statsheet
statsheet.players.each do |p|
+ #player = Player.where(id: p.player_id).first
player = p.player
+ puts 'NO PLAYER' if player.nil?
next if player.nil?
result = p.to_result
player.record.post_result result
@@ -42,8 +44,10 @@ def self.post_player_results statsheet
def self.unpost_player_results statsheet
statsheet.players.each do |p|
+ #player = Player.where(id: p.player_id).first
player = p.player
- next if player.nil?
+ puts 'NO PLAYER' if player.nil?
+ next if player.nil?
player.record.cancel_result_for_game statsheet.game_id
player.save
end
View
2  app/models/player.rb
@@ -23,6 +23,8 @@ class Player
before_save :ensure_record
before_save :set_slug
+
+ has_many :players
def full_name
[first_name, last_name].join(' ')
View
2  app/models/section.rb
@@ -4,7 +4,7 @@ class Section
embedded_in :page
field :pattern
- field :position, :type => Integer
+ field :position, :type => Integer, :default => 0
PATTERNS = [
"100",
View
2  config/application.rb
@@ -42,7 +42,7 @@ class Application < Rails::Application
config.assets.initialize_on_precompile = false
# Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.4'
+ config.assets.version = '1.5'
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
View
16 lib/patches/mongoid.rb
@@ -29,4 +29,20 @@ def <<(*args)
end
end
end
+
+ # monkey-patch issue with multiple sort on embedded
+# module Contextual
+# class Memory
+# def in_place_sort(values)
+# documents.sort! do |a, b|
+# a_value, b_value = [], []
+# values.keys.each do |field|
+# a_value << (values[field] < 0 ? b[field] : a[field])
+# b_value << (values[field] < 0 ? a[field] : b[field])
+# end
+# a_value <=> b_value
+# end
+# end
+# end
+# end
end
Please sign in to comment.
Something went wrong with that request. Please try again.