rebase develop branch with rails5 upgrade branch
This commit is contained in:
parent
0fcd8bc873
commit
3b5b79b0da
|
|
@ -9,7 +9,7 @@ ActiveAdmin.register JamRuby::User, :as => 'Students' do
|
|||
config.filters = true
|
||||
|
||||
def booked_anything(scope)
|
||||
scope.joins(:student_lesson_bookings).where('lesson_bookings.active = true').uniq
|
||||
scope.joins(:student_lesson_bookings).where('lesson_bookings.active = true').distinct
|
||||
end
|
||||
|
||||
filter :jamuser_full_name_or_email_cont, label: 'Name Or Email', as: :string
|
||||
|
|
@ -69,4 +69,4 @@ ActiveAdmin.register JamRuby::User, :as => 'Students' do
|
|||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'date'
|
||||
|
||||
class Cohort < ActiveRecord::Base
|
||||
class Cohort < ApplicationRecord
|
||||
|
||||
EARLIEST_DATE = Time.parse('2014-03-01')
|
||||
TOTAL_COHORT_DATE = Time.at(0)
|
||||
|
|
@ -75,7 +75,7 @@ class Cohort < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.generate_monthly_cohorts(monthly_start, monthly_end)
|
||||
Cohort.delete_all(['all_time = ?',false])
|
||||
Cohort.where(['all_time = ?',false]).delete_all()
|
||||
self.cohort_group_ranges.collect do |range|
|
||||
next if range.first > monthly_end
|
||||
cc = Cohort.new
|
||||
|
|
@ -90,7 +90,7 @@ class Cohort < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.generate_all_time_cohorts
|
||||
Cohort.delete_all("all_time = 't'")
|
||||
Cohort.where("all_time = 't'").delete_all()
|
||||
self.cohort_group_ranges.collect do |range|
|
||||
unless cc = Cohort.where(group_start: range.first).where(all_time: true).limit(1).first
|
||||
cc = Cohort.new
|
||||
|
|
|
|||
27
ruby/Gemfile
27
ruby/Gemfile
|
|
@ -20,19 +20,18 @@ else
|
|||
ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] ||= "true"
|
||||
end
|
||||
|
||||
if ENV['MODERN_OS'] == "1"
|
||||
gem 'pg', '0.21.0'
|
||||
else
|
||||
# on mac, bundle config build.pg --with-cflags="-Wno-error=implicit-function-declaration"
|
||||
gem 'pg', '0.17.1', :platform => [:mri, :mswin, :mingw]
|
||||
end
|
||||
|
||||
# on mac, bundle config build.pg --with-cflags="-Wno-error=implicit-function-declaration"
|
||||
gem 'pg' #, '0.17.1', :platform => [:mri, :mswin, :mingw]
|
||||
#gem 'jdbc_postgres', :platform => [:jruby]
|
||||
|
||||
gem 'activerecord', '= 4.2.8'
|
||||
gem 'railties', '= 4.2.8'
|
||||
gem 'actionmailer', '= 4.2.8'
|
||||
gem 'rails-observers', '0.1.2'
|
||||
gem 'protected_attributes' # needed to support attr_accessible
|
||||
gem 'activerecord', '= 5.1.7'
|
||||
#gem 'railties', '= 5.2.5'
|
||||
gem 'actionmailer', '= 5.1.7'
|
||||
gem 'rails-observers'
|
||||
#gem 'rails-observers', '0.1.2'
|
||||
#gem 'protected_attributes' # needed to support attr_accessible
|
||||
gem 'protected_attributes_continued'
|
||||
|
||||
# PINNED TO SUPPORT BOTH 2.3.1 and 2.4.1 Ruby simultaneously
|
||||
# This should be the same in ruby/admin/web/websocket-gateway
|
||||
|
|
@ -66,11 +65,11 @@ gem 'sendgrid', '1.2.0'
|
|||
gem 'aws-sdk', '~> 1'
|
||||
gem 'carrierwave', '0.9.0'
|
||||
gem 'aasm'
|
||||
gem 'devise', '3.3.0' # 3.4.0 causes: uninitialized constant ActionController::Metal (NameError)
|
||||
gem 'devise' #'3.3.0' # 3.4.0 causes: uninitialized constant ActionController::Metal (NameError)
|
||||
gem 'postgres-copy'
|
||||
gem 'geokit'
|
||||
gem 'geokit-rails'
|
||||
gem 'postgres_ext'
|
||||
#gem 'postgres_ext'
|
||||
gem 'resque'
|
||||
gem 'resque-retry'
|
||||
gem 'resque-failed-job-mailer' #, :path => "/Users/seth/workspace/resque_failed_job_mailer"
|
||||
|
|
@ -99,7 +98,7 @@ group :test do
|
|||
gem 'factory_girl', '4.5.0'
|
||||
gem "rspec", "2.11"
|
||||
gem 'spork', '0.9.0'
|
||||
gem 'database_cleaner', '1.4.1'
|
||||
gem 'database_cleaner' #, '1.4.1'
|
||||
gem 'faker', '1.3.0'
|
||||
gem 'resque_spec' #, :path => "/home/jam/src/resque_spec/"
|
||||
gem 'timecop'
|
||||
|
|
|
|||
|
|
@ -15,41 +15,44 @@ GEM
|
|||
CFPropertyList (2.3.6)
|
||||
aasm (5.1.1)
|
||||
concurrent-ruby (~> 1.0)
|
||||
actionmailer (4.2.8)
|
||||
actionpack (= 4.2.8)
|
||||
actionview (= 4.2.8)
|
||||
activejob (= 4.2.8)
|
||||
actioncable (5.1.7)
|
||||
actionpack (= 5.1.7)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (~> 0.6.1)
|
||||
actionmailer (5.1.7)
|
||||
actionpack (= 5.1.7)
|
||||
actionview (= 5.1.7)
|
||||
activejob (= 5.1.7)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
actionpack (4.2.8)
|
||||
actionview (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
rack (~> 1.6)
|
||||
rack-test (~> 0.6.2)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (5.1.7)
|
||||
actionview (= 5.1.7)
|
||||
activesupport (= 5.1.7)
|
||||
rack (~> 2.0)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
actionview (5.1.7)
|
||||
activesupport (= 5.1.7)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
erubi (~> 1.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||
activejob (4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
globalid (>= 0.3.0)
|
||||
activemodel (4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.2.8)
|
||||
activemodel (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
arel (~> 6.0)
|
||||
activejob (5.1.7)
|
||||
activesupport (= 5.1.7)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (5.1.7)
|
||||
activesupport (= 5.1.7)
|
||||
activerecord (5.1.7)
|
||||
activemodel (= 5.1.7)
|
||||
activesupport (= 5.1.7)
|
||||
arel (~> 8.0)
|
||||
activerecord-import (0.4.1)
|
||||
activerecord (>= 3.0)
|
||||
activesupport (4.2.8)
|
||||
i18n (~> 0.7)
|
||||
activesupport (5.1.7)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
|
|
@ -64,7 +67,7 @@ GEM
|
|||
amq-client (~> 1.0.2)
|
||||
amq-protocol (>= 1.3.0)
|
||||
eventmachine
|
||||
arel (6.0.4)
|
||||
arel (8.0.0)
|
||||
auto_strip_attributes (2.6.0)
|
||||
activerecord (>= 4.0)
|
||||
aws-sdk (1.67.0)
|
||||
|
|
@ -86,12 +89,17 @@ GEM
|
|||
rexml
|
||||
crass (1.0.6)
|
||||
dante (0.2.0)
|
||||
database_cleaner (1.4.1)
|
||||
devise (3.3.0)
|
||||
database_cleaner (2.0.1)
|
||||
database_cleaner-active_record (~> 2.0.0)
|
||||
database_cleaner-active_record (2.0.0)
|
||||
activerecord (>= 5.a)
|
||||
database_cleaner-core (~> 2.0.0)
|
||||
database_cleaner-core (2.0.1)
|
||||
devise (4.7.3)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
thread_safe (~> 0.1)
|
||||
railties (>= 4.1.0)
|
||||
responders
|
||||
warden (~> 1.2.3)
|
||||
diff-lcs (1.1.3)
|
||||
domain_name (0.5.20190701)
|
||||
|
|
@ -106,11 +114,11 @@ GEM
|
|||
multi_json
|
||||
email_validator (1.6.0)
|
||||
activemodel
|
||||
erubis (2.7.0)
|
||||
erubi (1.10.0)
|
||||
et-orbi (1.2.4)
|
||||
tzinfo
|
||||
eventmachine (1.0.4)
|
||||
excon (0.78.1)
|
||||
excon (0.80.1)
|
||||
factory_girl (4.5.0)
|
||||
activesupport (>= 3.0.0)
|
||||
faker (1.3.0)
|
||||
|
|
@ -267,7 +275,7 @@ GEM
|
|||
fog-core
|
||||
nokogiri (>= 1.5.11, < 2.0.0)
|
||||
formatador (0.2.5)
|
||||
fugit (1.4.2)
|
||||
fugit (1.4.5)
|
||||
et-orbi (~> 1.1, >= 1.1.8)
|
||||
raabro (~> 1.4)
|
||||
geokit (1.13.1)
|
||||
|
|
@ -296,7 +304,7 @@ GEM
|
|||
little-plugger (1.1.4)
|
||||
logging (1.7.2)
|
||||
little-plugger (>= 1.1.3)
|
||||
loofah (2.9.0)
|
||||
loofah (2.9.1)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.5.9)
|
||||
mail (2.7.1)
|
||||
|
|
@ -304,68 +312,65 @@ GEM
|
|||
method_source (1.0.0)
|
||||
mime-types (3.3.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2020.1104)
|
||||
mini_mime (1.0.2)
|
||||
mime-types-data (3.2021.0225)
|
||||
mini_mime (1.1.0)
|
||||
mini_portile2 (2.4.0)
|
||||
minitest (5.14.3)
|
||||
mono_logger (1.1.0)
|
||||
minitest (5.14.4)
|
||||
mono_logger (1.1.1)
|
||||
multi_json (1.15.0)
|
||||
multi_xml (0.6.0)
|
||||
multipart-post (2.1.1)
|
||||
mustermann (1.1.1)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
netrc (0.11.0)
|
||||
nio4r (2.5.7)
|
||||
nokogiri (1.10.10)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
nokogumbo (2.0.4)
|
||||
nokogumbo (2.0.5)
|
||||
nokogiri (~> 1.8, >= 1.8.4)
|
||||
oj (2.17.1)
|
||||
optimist (3.0.1)
|
||||
orm_adapter (0.5.0)
|
||||
pg (0.17.1)
|
||||
pg_array_parser (0.0.9)
|
||||
postgres-copy (1.2.0)
|
||||
activerecord (>= 4.0, < 5.1)
|
||||
pg (1.2.3)
|
||||
postgres-copy (1.5.0)
|
||||
activerecord (>= 5.1)
|
||||
pg (>= 0.17)
|
||||
responders
|
||||
postgres_ext (3.0.1)
|
||||
activerecord (~> 4.0)
|
||||
arel (>= 4.0.1)
|
||||
pg_array_parser (~> 0.0.9)
|
||||
protected_attributes (1.1.4)
|
||||
activemodel (>= 4.0.1, < 5.0)
|
||||
pry (0.13.1)
|
||||
protected_attributes_continued (1.8.1)
|
||||
activemodel (>= 5.0)
|
||||
pry (0.14.1)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
public_suffix (4.0.6)
|
||||
raabro (1.4.0)
|
||||
rack (1.6.13)
|
||||
rack-protection (1.5.5)
|
||||
rack (2.2.3)
|
||||
rack-protection (2.1.0)
|
||||
rack
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.2.8)
|
||||
actionmailer (= 4.2.8)
|
||||
actionpack (= 4.2.8)
|
||||
actionview (= 4.2.8)
|
||||
activejob (= 4.2.8)
|
||||
activemodel (= 4.2.8)
|
||||
activerecord (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.2.8)
|
||||
sprockets-rails
|
||||
rails-deprecated_sanitizer (1.0.3)
|
||||
activesupport (>= 4.2.0.alpha)
|
||||
rails-dom-testing (1.0.9)
|
||||
activesupport (>= 4.2.0, < 5.0)
|
||||
nokogiri (~> 1.6)
|
||||
rails-deprecated_sanitizer (>= 1.0.1)
|
||||
rack-test (1.1.0)
|
||||
rack (>= 1.0, < 3)
|
||||
rails (5.1.7)
|
||||
actioncable (= 5.1.7)
|
||||
actionmailer (= 5.1.7)
|
||||
actionpack (= 5.1.7)
|
||||
actionview (= 5.1.7)
|
||||
activejob (= 5.1.7)
|
||||
activemodel (= 5.1.7)
|
||||
activerecord (= 5.1.7)
|
||||
activesupport (= 5.1.7)
|
||||
bundler (>= 1.3.0)
|
||||
railties (= 5.1.7)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
rails-dom-testing (2.0.3)
|
||||
activesupport (>= 4.2.0)
|
||||
nokogiri (>= 1.6)
|
||||
rails-html-sanitizer (1.3.0)
|
||||
loofah (~> 2.3)
|
||||
rails-observers (0.1.2)
|
||||
activemodel (~> 4.0)
|
||||
railties (4.2.8)
|
||||
actionpack (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
rails-observers (0.1.5)
|
||||
activemodel (>= 4.0)
|
||||
railties (5.1.7)
|
||||
actionpack (= 5.1.7)
|
||||
activesupport (= 5.1.7)
|
||||
method_source
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rake (13.0.3)
|
||||
|
|
@ -378,9 +383,9 @@ GEM
|
|||
redis (3.3.0)
|
||||
redis-namespace (1.5.2)
|
||||
redis (~> 3.0, >= 3.0.4)
|
||||
responders (2.4.1)
|
||||
actionpack (>= 4.2.0, < 6.0)
|
||||
railties (>= 4.2.0, < 6.0)
|
||||
responders (3.0.1)
|
||||
actionpack (>= 5.0)
|
||||
railties (>= 5.0)
|
||||
resque (1.27.4)
|
||||
mono_logger (~> 1.0)
|
||||
multi_json (~> 1.0)
|
||||
|
|
@ -411,7 +416,7 @@ GEM
|
|||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 4.0)
|
||||
netrc (~> 0.8)
|
||||
rexml (3.2.4)
|
||||
rexml (3.2.5)
|
||||
rspec (2.11.0)
|
||||
rspec-core (~> 2.11.0)
|
||||
rspec-expectations (~> 2.11.0)
|
||||
|
|
@ -425,6 +430,7 @@ GEM
|
|||
ruby-prof
|
||||
ruby-prof (0.15.9)
|
||||
ruby-protocol-buffers (1.2.2)
|
||||
ruby2_keywords (0.0.4)
|
||||
rubyzip (1.2.0)
|
||||
rufus-scheduler (3.7.0)
|
||||
fugit (~> 1.1, >= 1.1.6)
|
||||
|
|
@ -442,10 +448,11 @@ GEM
|
|||
simplecov-html (0.7.1)
|
||||
simplecov-rcov (0.2.3)
|
||||
simplecov (>= 0.4.1)
|
||||
sinatra (1.4.8)
|
||||
rack (~> 1.5)
|
||||
rack-protection (~> 1.4)
|
||||
tilt (>= 1.3, < 3)
|
||||
sinatra (2.1.0)
|
||||
mustermann (~> 1.0)
|
||||
rack (~> 2.2)
|
||||
rack-protection (= 2.1.0)
|
||||
tilt (~> 2.0)
|
||||
spork (0.9.0)
|
||||
sprockets (3.6.3)
|
||||
concurrent-ruby (~> 1.0)
|
||||
|
|
@ -454,7 +461,7 @@ GEM
|
|||
actionpack (>= 4.0)
|
||||
activesupport (>= 4.0)
|
||||
sprockets (>= 3.0.0)
|
||||
stripe (5.29.0)
|
||||
stripe (5.32.1)
|
||||
stripe-ruby-mock (3.0.1)
|
||||
dante (>= 0.2.0)
|
||||
multi_json (~> 1.0)
|
||||
|
|
@ -462,9 +469,9 @@ GEM
|
|||
thor (1.1.0)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.10)
|
||||
time_difference (0.5.0)
|
||||
activesupport
|
||||
timecop (0.9.2)
|
||||
time_difference (0.7.0)
|
||||
activesupport (~> 5.1)
|
||||
timecop (0.9.4)
|
||||
tzinfo (1.2.9)
|
||||
thread_safe (~> 0.1)
|
||||
unf (0.1.4)
|
||||
|
|
@ -473,15 +480,20 @@ GEM
|
|||
uuidtools (2.1.2)
|
||||
vegas (0.1.11)
|
||||
rack (>= 1.0.0)
|
||||
warden (1.2.7)
|
||||
rack (>= 1.0)
|
||||
webmock (3.11.2)
|
||||
warden (1.2.9)
|
||||
rack (>= 2.0.9)
|
||||
webmock (3.12.2)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
webrick (1.7.0)
|
||||
websocket-driver (0.6.5)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.5)
|
||||
will_paginate (3.3.0)
|
||||
xml-simple (1.1.8)
|
||||
xmlrpc (0.3.1)
|
||||
xmlrpc (0.3.2)
|
||||
webrick
|
||||
zip-codes (0.2.1)
|
||||
|
||||
PLATFORMS
|
||||
|
|
@ -489,8 +501,8 @@ PLATFORMS
|
|||
|
||||
DEPENDENCIES
|
||||
aasm
|
||||
actionmailer (= 4.2.8)
|
||||
activerecord (= 4.2.8)
|
||||
actionmailer (= 5.1.7)
|
||||
activerecord (= 5.1.7)
|
||||
activerecord-import (~> 0.4.1)
|
||||
amqp (= 1.0.2)
|
||||
auto_strip_attributes
|
||||
|
|
@ -499,8 +511,8 @@ DEPENDENCIES
|
|||
bcrypt-ruby
|
||||
builder
|
||||
carrierwave (= 0.9.0)
|
||||
database_cleaner (= 1.4.1)
|
||||
devise (= 3.3.0)
|
||||
database_cleaner
|
||||
devise
|
||||
elasticsearch
|
||||
email_validator (= 1.6.0)
|
||||
eventmachine (= 1.0.4)
|
||||
|
|
@ -520,13 +532,11 @@ DEPENDENCIES
|
|||
logging (= 1.7.2)
|
||||
nokogiri (= 1.10.10)
|
||||
oj (= 2.17.1)
|
||||
pg (= 0.17.1)
|
||||
pg
|
||||
postgres-copy
|
||||
postgres_ext
|
||||
protected_attributes
|
||||
protected_attributes_continued
|
||||
pry
|
||||
rails-observers (= 0.1.2)
|
||||
railties (= 4.2.8)
|
||||
rails-observers
|
||||
recurly (= 2.18.16)
|
||||
redis (= 3.3.0)
|
||||
redis-namespace (= 1.5.2)
|
||||
|
|
@ -562,4 +572,4 @@ RUBY VERSION
|
|||
ruby 2.4.1p111
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.3
|
||||
2.2.15
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class CreateInitStructure < ActiveRecord::Migration
|
||||
class CreateInitStructure < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
# this can't apply in production or staging, -- and schema.rb captures this test/dev environments
|
||||
return if ENV['RAILS_ENV'] == 'production'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class PayPalFieldForAffiliate < ActiveRecord::Migration
|
||||
class PayPalFieldForAffiliate < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
execute "ALTER TABLE affiliate_partners ADD COLUMN paypal_id VARCHAR(255)"
|
||||
execute %(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ChangeAffiliateDistributionsSaleLineItemIdNotNull < ActiveRecord::Migration
|
||||
class ChangeAffiliateDistributionsSaleLineItemIdNotNull < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
#change_column_null :affiliate_distributions, :sale_line_item_id, true
|
||||
execute "ALTER TABLE affiliate_distributions ALTER COLUMN sale_line_item_id DROP NOT NULL"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddRecurlyTransactionsLastSyncAtToGenericState < ActiveRecord::Migration
|
||||
class AddRecurlyTransactionsLastSyncAtToGenericState < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
#add_column :generic_state, :recurly_transactions_last_sync_at, :datetime
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddProductTypeToAffiliateDistributions < ActiveRecord::Migration
|
||||
class AddProductTypeToAffiliateDistributions < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
execute("ALTER TABLE affiliate_distributions ADD COLUMN product_type VARCHAR(64)")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class SetDefaultForAffiliateDistributionsProductType < ActiveRecord::Migration
|
||||
class SetDefaultForAffiliateDistributionsProductType < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
execute("UPDATE affiliate_distributions SET product_type = 'JamTrack'")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddProductCodeToAffiliateDistributions < ActiveRecord::Migration
|
||||
class AddProductCodeToAffiliateDistributions < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
execute("ALTER TABLE affiliate_distributions ADD COLUMN product_code VARCHAR(64)")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamTrackShareInCentsToAffiliatePartners < ActiveRecord::Migration
|
||||
class JamTrackShareInCentsToAffiliatePartners < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
execute("ALTER TABLE affiliate_partners ADD COLUMN jamtrack_share_in_cents NUMERIC(8,2)")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class SetDefaultValuesOfJamTrackShareInCents < ActiveRecord::Migration
|
||||
class SetDefaultValuesOfJamTrackShareInCents < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
execute("UPDATE affiliate_partners SET jamtrack_share_in_cents = 25")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddFirstSubscribedAtToUsers < ActiveRecord::Migration
|
||||
class AddFirstSubscribedAtToUsers < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
execute("ALTER TABLE users ADD COLUMN first_subscribed_at TIMESTAMP WITHOUT TIME ZONE")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddExternalIdToAffiliateDistributions < ActiveRecord::Migration
|
||||
class AddExternalIdToAffiliateDistributions < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
execute("ALTER TABLE affiliate_distributions ADD COLUMN external_id character varying(64)")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ChangeAffiliatePartnersRateDefault < ActiveRecord::Migration
|
||||
class ChangeAffiliatePartnersRateDefault < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
execute("ALTER TABLE affiliate_partners ALTER COLUMN rate SET DEFAULT 0.30")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddUseVideoConferencingServerToUsers < ActiveRecord::Migration
|
||||
class AddUseVideoConferencingServerToUsers < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
execute("ALTER TABLE users ADD COLUMN use_video_conferencing_server BOOLEAN DEFAULT FALSE;")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class CreateTempTokens < ActiveRecord::Migration
|
||||
class CreateTempTokens < ActiveRecord::Migration[4.2]
|
||||
|
||||
def self.up
|
||||
execute( <<-SQL
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
require "pg"
|
||||
require "active_record"
|
||||
require "rails/railtie"
|
||||
require "protected_attributes"
|
||||
require "protected_attributes_continued"
|
||||
require "rails-observers"
|
||||
require "rails/observers/active_model"
|
||||
require "rails/observers/activerecord/active_record"
|
||||
|
|
@ -19,7 +19,7 @@ require "sendgrid"
|
|||
require "postgres-copy"
|
||||
require "geokit"
|
||||
require "geokit-rails"
|
||||
require "postgres_ext"
|
||||
#require "postgres_ext"
|
||||
require 'builder'
|
||||
require 'cgi'
|
||||
require 'resque_mailer'
|
||||
|
|
@ -31,7 +31,8 @@ require 'stripe'
|
|||
require 'zip-codes'
|
||||
require 'email_validator'
|
||||
|
||||
ActiveRecord::Base.raise_in_transactional_callbacks = true
|
||||
#ActiveRecord::Base.raise_in_transactional_callbacks = true
|
||||
require "jam_ruby/app/models/application_record"
|
||||
require "jam_ruby/lib/timezone"
|
||||
require "jam_ruby/constants/limits"
|
||||
require "jam_ruby/constants/notification_types"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
end
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class ActiveMusicSession < ActiveRecord::Base
|
||||
class ActiveMusicSession < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[ActiveMusicSession]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class AffiliateDistribution < ActiveRecord::Base
|
||||
class AffiliateDistribution < ApplicationRecord
|
||||
|
||||
|
||||
belongs_to :sale_line_item, class_name: 'JamRuby::SaleLineItem'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::AffiliateLegalese < ActiveRecord::Base
|
||||
class JamRuby::AffiliateLegalese < ApplicationRecord
|
||||
self.table_name = 'affiliate_legalese'
|
||||
|
||||
has_many :affiliate_partners, :class_name => "JamRuby::AffiliatePartner", :foreign_key => :legalese_id
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::AffiliateLink < ActiveRecord::Base
|
||||
class JamRuby::AffiliateLink < ApplicationRecord
|
||||
|
||||
attr_accessible :link, :name, as: :admin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::AffiliateMonthlyPayment < ActiveRecord::Base
|
||||
class JamRuby::AffiliateMonthlyPayment < ApplicationRecord
|
||||
|
||||
belongs_to :affiliate_partner, class_name: 'JamRuby::AffiliatePartner', inverse_of: :months
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::AffiliatePartner < ActiveRecord::Base
|
||||
class JamRuby::AffiliatePartner < ApplicationRecord
|
||||
self.table_name = 'affiliate_partners'
|
||||
|
||||
belongs_to :partner_user, :class_name => "JamRuby::User", :foreign_key => :partner_user_id, inverse_of: :affiliate_partner
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class AffiliatePayment < ActiveRecord::Base
|
||||
class AffiliatePayment < ApplicationRecord
|
||||
|
||||
belongs_to :affiliate_monthly_payment
|
||||
belongs_to :affiliate_quarterly_payment
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::AffiliateQuarterlyPayment < ActiveRecord::Base
|
||||
class JamRuby::AffiliateQuarterlyPayment < ApplicationRecord
|
||||
|
||||
belongs_to :affiliate_partner, class_name: 'JamRuby::AffiliatePartner', inverse_of: :quarters
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::AffiliateReferralVisit < ActiveRecord::Base
|
||||
class JamRuby::AffiliateReferralVisit < ApplicationRecord
|
||||
|
||||
belongs_to :affiliate_partner, class_name: 'JamRuby::AffiliatePartner', inverse_of: :visits
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::AffiliateTrafficTotal < ActiveRecord::Base
|
||||
class JamRuby::AffiliateTrafficTotal < ApplicationRecord
|
||||
|
||||
belongs_to :affiliate_partner, class_name: 'JamRuby::AffiliatePartner', inverse_of: :traffic_totals
|
||||
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ module JamRuby
|
|||
end
|
||||
|
||||
def destroy_all_shopping_carts
|
||||
ShoppingCart.destroy_all(anonymous_user_id: @id)
|
||||
ShoppingCart.where(anonymous_user_id: @id).destroy_all()
|
||||
end
|
||||
|
||||
def destroy_jam_track_shopping_carts
|
||||
ShoppingCart.destroy_all(anonymous_user_id: @id, cart_type: JamTrack::PRODUCT_TYPE)
|
||||
ShoppingCart.where(anonymous_user_id: @id, cart_type: JamTrack::PRODUCT_TYPE).destroy_all()
|
||||
end
|
||||
|
||||
def admin
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
module JamRuby
|
||||
class Ars < ActiveRecord::Base
|
||||
class Ars < ApplicationRecord
|
||||
|
||||
attr_accessible :active, :name, :id_int, :ip, as: :admin
|
||||
|
||||
|
|
@ -11,4 +11,4 @@ module JamRuby
|
|||
Ars.where(active: true, beta: beta).where('ip is not NULL').where("ip != ''").all
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class ArtifactUpdate < ActiveRecord::Base
|
||||
class ArtifactUpdate < ApplicationRecord
|
||||
|
||||
DEFAULT_ENVIRONMENT = 'public'
|
||||
CLIENT_PREFIX = 'JamClient'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class BackingTrack < ActiveRecord::Base
|
||||
class BackingTrack < ApplicationRecord
|
||||
|
||||
self.table_name = "backing_tracks"
|
||||
self.primary_key = 'id'
|
||||
|
|
@ -16,4 +16,4 @@ module JamRuby
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Band < ActiveRecord::Base
|
||||
class Band < ApplicationRecord
|
||||
include HtmlSanitize
|
||||
html_sanitize strict: [:biography, :website, :name]
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ module JamRuby
|
|||
.order('created_at DESC')
|
||||
.limit(10)
|
||||
|
||||
result = recordings.concat(msh)
|
||||
result = recordings.to_a.concat(msh.to_a)
|
||||
result.sort! {|a,b| b.created_at <=> a.created_at}.first(5)
|
||||
end
|
||||
|
||||
|
|
@ -218,8 +218,8 @@ module JamRuby
|
|||
end
|
||||
|
||||
unless band.new_record?
|
||||
OnlinePresence.delete_all(["player_id = ?", band.id])
|
||||
PerformanceSample.delete_all(["player_id = ?", band.id])
|
||||
OnlinePresence.where(["player_id = ?", band.id]).delete_all()
|
||||
PerformanceSample.where(["player_id = ?", band.id]).delete_all()
|
||||
end
|
||||
|
||||
online_presences = params[:online_presences]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class BandInvitation < ActiveRecord::Base
|
||||
class BandInvitation < ApplicationRecord
|
||||
|
||||
self.table_name = "band_invitations"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class BandMusician < ActiveRecord::Base
|
||||
class BandMusician < ApplicationRecord
|
||||
|
||||
self.table_name = "bands_musicians"
|
||||
|
||||
|
|
@ -32,4 +32,4 @@ module JamRuby
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
module JamRuby
|
||||
class Broadcast < ActiveRecord::Base
|
||||
class Broadcast < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[Broadcast]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class BroadcastNotification < ActiveRecord::Base
|
||||
class BroadcastNotification < ApplicationRecord
|
||||
|
||||
attr_accessible :title, :message, :button_label, :frequency, :button_url, as: :admin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class BroadcastNotificationView < ActiveRecord::Base
|
||||
class BroadcastNotificationView < ApplicationRecord
|
||||
|
||||
belongs_to :broadcast_notification, :class_name => 'JamRuby::BroadcastNotification'
|
||||
belongs_to :user, :class_name => 'JamRuby::User'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Calendar < ActiveRecord::Base
|
||||
class Calendar < ApplicationRecord
|
||||
include HtmlSanitize
|
||||
html_sanitize strict: [:name, :description]
|
||||
attr_accessible :name, :description, :target_uid, :trigger_delete, :start_at, :end_at
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class CampaignSpend < ActiveRecord::Base
|
||||
class CampaignSpend < ApplicationRecord
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Charge < ActiveRecord::Base
|
||||
class Charge < ApplicationRecord
|
||||
|
||||
attr_accessor :stripe_charge
|
||||
|
||||
|
|
@ -152,4 +152,4 @@ module JamRuby
|
|||
self.save(validate: false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class ChatMessage < ActiveRecord::Base
|
||||
class ChatMessage < ApplicationRecord
|
||||
include HtmlSanitize
|
||||
html_sanitize strict: [:message]
|
||||
|
||||
|
|
@ -193,4 +193,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class City < ActiveRecord::Base
|
||||
class City < ApplicationRecord
|
||||
|
||||
self.table_name = 'cities'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class ClaimedRecording < ActiveRecord::Base
|
||||
class ClaimedRecording < ApplicationRecord
|
||||
include HtmlSanitize
|
||||
html_sanitize strict: [:name, :description]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
module JamRuby
|
||||
class ClientLiveStream < ActiveRecord::Base
|
||||
class ClientLiveStream < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[ClientLiveStream]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
require 'aasm'
|
||||
|
||||
module JamRuby
|
||||
class Connection < ActiveRecord::Base
|
||||
class Connection < ApplicationRecord
|
||||
|
||||
include HtmlSanitize
|
||||
include AASM
|
||||
|
|
@ -203,7 +203,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def report_add_participant
|
||||
if self.music_session_id_changed? &&
|
||||
if self.saved_change_to_music_session_id? &&
|
||||
self.music_session.present? &&
|
||||
self.connected? &&
|
||||
self.as_musician? &&
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Country < ActiveRecord::Base
|
||||
class Country < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[Country]
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ module JamRuby
|
|||
|
||||
csv = ::CSV.new(io, {encoding: 'ISO-8859-1', headers: false})
|
||||
csv.each do |row|
|
||||
vals = vals+sep+"(#{ActiveRecord::Base.quote_value(row[0], nil)}, #{ActiveRecord::Base.quote_value(row[1], nil)})"
|
||||
vals = vals+sep+"(#{ActiveRecord::Base.connection.quote(row[0])}, #{ActiveRecord::Base.connection.quote(row[1])})"
|
||||
sep = ','
|
||||
i += 1
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class CrashDump < ActiveRecord::Base
|
||||
class CrashDump < ApplicationRecord
|
||||
|
||||
include JamRuby::S3AnalyticsManagerMixin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Diagnostic < ActiveRecord::Base
|
||||
class Diagnostic < ApplicationRecord
|
||||
|
||||
# occurs when the client does not see a heartbeat from the server in a while
|
||||
NO_HEARTBEAT_ACK = 'NO_HEARTBEAT_ACK'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class DownloadTracker < ActiveRecord::Base
|
||||
class DownloadTracker < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[DownloadTracker]
|
||||
|
||||
|
|
@ -145,4 +145,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class EmailBatch < ActiveRecord::Base
|
||||
class EmailBatch < ApplicationRecord
|
||||
self.table_name = "email_batches"
|
||||
|
||||
has_many :email_batch_sets, :class_name => 'JamRuby::EmailBatchSet'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class EmailBatchSet < ActiveRecord::Base
|
||||
class EmailBatchSet < ApplicationRecord
|
||||
self.table_name = "email_batch_sets"
|
||||
|
||||
belongs_to :email_batch, :class_name => 'JamRuby::EmailBatch'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class EmailBlacklist < ActiveRecord::Base
|
||||
class EmailBlacklist < ApplicationRecord
|
||||
|
||||
attr_accessible :email, :source, :notes, as: :admin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::Event < ActiveRecord::Base
|
||||
class JamRuby::Event < ApplicationRecord
|
||||
|
||||
attr_accessible :slug, :title, :description, :show_sponser, :social_description, as: :admin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::EventBriteOrder < ActiveRecord::Base
|
||||
class JamRuby::EventBriteOrder < ApplicationRecord
|
||||
|
||||
|
||||
belongs_to :live_stream, class_name: 'JamRuby::LiveStream'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::EventBriteOrderUpload < ActiveRecord::Base
|
||||
class JamRuby::EventBriteOrderUpload < ApplicationRecord
|
||||
has_many :event_brite_orders, class_name: 'JamRuby::EventBriteOrder'
|
||||
|
||||
validates :upload_file_name, presence: true
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class JamRuby::EventSession < ActiveRecord::Base
|
||||
class JamRuby::EventSession < ApplicationRecord
|
||||
|
||||
attr_accessible :event_id, :user_id, :band_id, :starts_at, :ends_at, :pinned_state, :position, :img_url, :img_width, :img_height, :ordinal, as: :admin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class FacebookSignup < ActiveRecord::Base
|
||||
class FacebookSignup < ApplicationRecord
|
||||
|
||||
before_create :generate_lookup_id
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class FanInvitation < ActiveRecord::Base
|
||||
class FanInvitation < ApplicationRecord
|
||||
|
||||
FRIENDSHIP_REQUIRED_VALIDATION_ERROR = "You can only invite friends"
|
||||
MEMBERSHIP_REQUIRED_OF_MUSIC_SESSION = "You must be a member of the music session to send invitations on behalf of it"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Feed < ActiveRecord::Base
|
||||
class Feed < ApplicationRecord
|
||||
|
||||
belongs_to :recording, class_name: "JamRuby::Recording", inverse_of: :feed, foreign_key: 'recording_id'
|
||||
belongs_to :music_session, class_name: "JamRuby::MusicSession", inverse_of: :feed, foreign_key: 'music_session_id'
|
||||
|
|
@ -32,8 +32,13 @@ module JamRuby
|
|||
target_band = params[:band]
|
||||
|
||||
# TODO: SPEED UP QUERY. CURRENTLY TAKES FOR EVER.
|
||||
if target_user or target_band
|
||||
return { query: [], next_page: nil}
|
||||
if target_user or target_band and !APP_CONFIG.personal_feed_enabled
|
||||
if params[:hash]
|
||||
return { query: [], next_page: nil}
|
||||
else
|
||||
return [[], nil]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#query = Feed.includes([:recording]).includes([:music_session]).limit(limit)
|
||||
|
|
@ -132,4 +137,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class FingerprintWhitelist < ActiveRecord::Base
|
||||
class FingerprintWhitelist < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[FingerprintWhitelist]
|
||||
|
||||
|
|
@ -14,4 +14,4 @@ module JamRuby
|
|||
"#{fingerprint}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Follow < ActiveRecord::Base
|
||||
class Follow < ApplicationRecord
|
||||
|
||||
belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "user_id"
|
||||
belongs_to :followable, :polymorphic => true
|
||||
|
|
@ -10,4 +10,4 @@ module JamRuby
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class FraudAlert < ActiveRecord::Base
|
||||
class FraudAlert < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[MachineExtra]
|
||||
|
||||
|
|
@ -23,4 +23,4 @@ module JamRuby
|
|||
APP_CONFIG.admin_root_url + "/admin/fraud_alerts/" + id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class FriendRequest < ActiveRecord::Base
|
||||
class FriendRequest < ApplicationRecord
|
||||
include HtmlSanitize
|
||||
html_sanitize strict: [:message]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Friendship < ActiveRecord::Base
|
||||
class Friendship < ApplicationRecord
|
||||
|
||||
attr_accessible :user_id, :friend_id
|
||||
|
||||
|
|
@ -67,4 +67,4 @@ module JamRuby
|
|||
self.user.update_progression_field(:first_friended_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
module JamRuby
|
||||
class GenericState < ActiveRecord::Base
|
||||
class GenericState < ApplicationRecord
|
||||
|
||||
|
||||
attr_accessible :top_message, :event_page_top_logo_url, :connection_policy, :customer_ltv, as: :admin
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Genre < ActiveRecord::Base
|
||||
class Genre < ApplicationRecord
|
||||
|
||||
self.primary_key = 'id'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class GenreJamTrack < ActiveRecord::Base
|
||||
class GenreJamTrack < ApplicationRecord
|
||||
|
||||
self.table_name = 'genres_jam_tracks'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class GenrePlayer < ActiveRecord::Base
|
||||
class GenrePlayer < ApplicationRecord
|
||||
|
||||
PROFILE = 'profile'
|
||||
VIRTUAL_BAND = 'virtual_band'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class GeoIpBlocks < ActiveRecord::Base
|
||||
class GeoIpBlocks < ApplicationRecord
|
||||
|
||||
# index names created on the copied table used during import.
|
||||
# they do not exist except during import
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class GeoIpLocations < ActiveRecord::Base
|
||||
class GeoIpLocations < ApplicationRecord
|
||||
|
||||
# index names created on the copied table used during import.
|
||||
# they do not exist except during import
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class GetWork < ActiveRecord::Base
|
||||
class GetWork < ApplicationRecord
|
||||
|
||||
self.table_name = "connections"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# represents the gift card you hold in your hand
|
||||
module JamRuby
|
||||
class GiftCard < ActiveRecord::Base
|
||||
class GiftCard < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[GiftCard]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# reperesents the gift card you buy from the site (but physical gift card is modeled by GiftCard)
|
||||
module JamRuby
|
||||
class GiftCardPurchase < ActiveRecord::Base
|
||||
class GiftCardPurchase < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[GiftCardPurchase]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# reperesents the gift card you buy from the site (but physical gift card is modeled by GiftCard)
|
||||
module JamRuby
|
||||
class GiftCardType < ActiveRecord::Base
|
||||
class GiftCardType < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[GiftCardType]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastAdminAuthentication < ActiveRecord::Base
|
||||
class IcecastAdminAuthentication < ApplicationRecord
|
||||
|
||||
attr_accessible :source_pass, :relay_user, :relay_pass, :admin_user, :admin_pass, as: :admin
|
||||
|
||||
|
|
@ -35,4 +35,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastDirectory < ActiveRecord::Base
|
||||
class IcecastDirectory < ApplicationRecord
|
||||
|
||||
attr_accessible :yp_url_timeout, :yp_url, as: :admin
|
||||
|
||||
|
|
@ -29,4 +29,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastLimit < ActiveRecord::Base
|
||||
class IcecastLimit < ApplicationRecord
|
||||
|
||||
attr_accessible :clients, :sources, :queue_size, :client_timeout, :header_timeout, :source_timeout, :burst_size,
|
||||
as: :admin
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastListenSocket < ActiveRecord::Base
|
||||
class IcecastListenSocket < ApplicationRecord
|
||||
|
||||
attr_accessible :port, :bind_address, :shoutcast_mount, :shoutcast_compat, as: :admin
|
||||
|
||||
|
|
@ -33,4 +33,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastLogging < ActiveRecord::Base
|
||||
class IcecastLogging < ApplicationRecord
|
||||
|
||||
attr_accessible :access_log, :error_log, :playlist_log, :log_level, :log_archive, :log_size, as: :admin
|
||||
|
||||
|
|
@ -34,4 +34,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastMasterServerRelay < ActiveRecord::Base
|
||||
class IcecastMasterServerRelay < ApplicationRecord
|
||||
|
||||
attr_accessible :master_server, :master_server_port, :master_update_interval, :master_username, :master_pass,
|
||||
:relays_on_demand, as: :admin
|
||||
|
|
@ -35,4 +35,4 @@ module JamRuby
|
|||
builder.tag! 'relays-on-demand', relays_on_demand
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastMount < ActiveRecord::Base
|
||||
class IcecastMount < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[IcecastMount]
|
||||
|
||||
|
|
@ -51,22 +51,22 @@ module JamRuby
|
|||
def after_save
|
||||
server.update_attribute(:config_changed, 1) unless no_config_changed
|
||||
|
||||
if !sourced_was && sourced
|
||||
if !sourced_before_last_save && sourced
|
||||
|
||||
# went from NOT SOURCED to SOURCED
|
||||
notify_source_up
|
||||
|
||||
elsif sourced_was && !sourced
|
||||
elsif sourced_before_last_save && !sourced
|
||||
|
||||
# went from SOURCED to NOT SOURCED
|
||||
notify_source_down
|
||||
|
||||
end
|
||||
|
||||
if source_direction_was != source_direction
|
||||
if source_direction_before_last_save != source_direction
|
||||
# temporarily removed; it seems better to leave all the data in for now. It should never be that much
|
||||
# if the requested source direction has changed, then delete diagnostic info
|
||||
#IcecastSourceChange.delete_all(["icecast_mount_id = ?", self.id]) if source_direction
|
||||
#IcecastSourceChange.where(["icecast_mount_id = ?", self.id]).delete_all() if source_direction
|
||||
|
||||
# and tell anyone listening that the direction has changed
|
||||
# SubscriptionMessage.mount_source_direction(self)
|
||||
|
|
@ -368,4 +368,4 @@ module JamRuby
|
|||
resolve_int(field)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastMountTemplate < ActiveRecord::Base
|
||||
class IcecastMountTemplate < ApplicationRecord
|
||||
|
||||
attr_accessor :hostname, :default_mime_type # used by jam-admin
|
||||
|
||||
|
|
@ -59,4 +59,4 @@ module JamRuby
|
|||
mount
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastPath < ActiveRecord::Base
|
||||
class IcecastPath < ApplicationRecord
|
||||
|
||||
attr_accessible :base_dir, :log_dir, :pid_file, :web_root, :admin_root, :allow_ip, :deny_ip, :alias_source,
|
||||
:alias_dest, as: :admin
|
||||
|
|
@ -38,4 +38,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastRelay < ActiveRecord::Base
|
||||
class IcecastRelay < ApplicationRecord
|
||||
|
||||
attr_accessible :server, :port, :mount, :local_mount, :relay_username, :relay_pass, :relay_shoutcast_metadata, :on_demand,
|
||||
as: :admin
|
||||
|
|
@ -37,4 +37,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastSecurity < ActiveRecord::Base
|
||||
class IcecastSecurity < ApplicationRecord
|
||||
|
||||
attr_accessible :chroot, :change_owner_user, :change_owner_group, as: :admin
|
||||
|
||||
|
|
@ -32,4 +32,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastServer < ActiveRecord::Base
|
||||
class IcecastServer < ApplicationRecord
|
||||
|
||||
attr_accessor :skip_config_changed_flag
|
||||
|
||||
|
|
@ -191,4 +191,4 @@ module JamRuby
|
|||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastServerGroup < ActiveRecord::Base
|
||||
class IcecastServerGroup < ApplicationRecord
|
||||
|
||||
attr_accessible :name, as: :admin
|
||||
|
||||
|
|
@ -8,4 +8,4 @@ module JamRuby
|
|||
|
||||
validates :name, presence: true, uniqueness: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastServerMount < ActiveRecord::Base
|
||||
class IcecastServerMount < ApplicationRecord
|
||||
self.table_name = 'icecast_server_mounts'
|
||||
|
||||
attr_accessible :icecast_mount_id, :icecast_server_id, as: :admin
|
||||
|
|
@ -10,4 +10,4 @@ module JamRuby
|
|||
validates :server, :presence => true
|
||||
validates :mount, :presence => true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastServerRelay < ActiveRecord::Base
|
||||
class IcecastServerRelay < ApplicationRecord
|
||||
|
||||
self.table_name = 'icecast_server_relays'
|
||||
|
||||
|
|
@ -13,4 +13,4 @@ module JamRuby
|
|||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastServerSocket < ActiveRecord::Base
|
||||
class IcecastServerSocket < ApplicationRecord
|
||||
|
||||
self.table_name = 'icecast_server_sockets'
|
||||
|
||||
|
|
@ -18,4 +18,4 @@ module JamRuby
|
|||
server.update_attribute(:config_changed, 1) if server
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastSourceChange < ActiveRecord::Base
|
||||
class IcecastSourceChange < ApplicationRecord
|
||||
|
||||
@@log = Logging.logger[IcecastSourceChange]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastTemplate < ActiveRecord::Base
|
||||
class IcecastTemplate < ApplicationRecord
|
||||
|
||||
attr_accessible :limit_id, :admin_auth_id, :directory_id, :master_relay_id, :path_id, :logging_id,
|
||||
:security_id, :name, :location, :admin_email, :fileserve, as: :admin
|
||||
|
|
@ -50,4 +50,4 @@ module JamRuby
|
|||
self.security_id = nil if self.security_id == ''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastTemplateSocket < ActiveRecord::Base
|
||||
class IcecastTemplateSocket < ApplicationRecord
|
||||
|
||||
self.table_name = 'icecast_template_sockets'
|
||||
|
||||
|
|
@ -18,4 +18,4 @@ module JamRuby
|
|||
template.servers.update_all(config_changed: 1) if template
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class IcecastUserAuthentication < ActiveRecord::Base
|
||||
class IcecastUserAuthentication < ApplicationRecord
|
||||
|
||||
attr_accessible :authentication_type, :filename, :allow_duplicate_users, :mount_add, :mount_remove, :listener_add,
|
||||
:listener_remove, :unused_username, :unused_pass, :auth_header, :timelimit_header, as: :admin
|
||||
|
|
@ -58,4 +58,4 @@ module JamRuby
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Instrument < ActiveRecord::Base
|
||||
class Instrument < ApplicationRecord
|
||||
|
||||
MAP_ICON_NAME = {
|
||||
"accordion" => "accordion",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class Invitation < ActiveRecord::Base
|
||||
class Invitation < ApplicationRecord
|
||||
|
||||
INVITATION_NOT_TEACHER_VALIDATION_ERROR = "Lessons can only sent invitations to teachers"
|
||||
FRIENDSHIP_REQUIRED_VALIDATION_ERROR = "You can only invite friends"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module JamRuby
|
||||
class InvitedUser < ActiveRecord::Base
|
||||
class InvitedUser < ApplicationRecord
|
||||
include HtmlSanitize
|
||||
html_sanitize strict: [:note]
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue