diff --git a/app/assets/javascripts/billing.js b/app/assets/javascripts/billing.js new file mode 100644 index 00000000..d67fd05c --- /dev/null +++ b/app/assets/javascripts/billing.js @@ -0,0 +1,7 @@ +$(document).ready(function () { + $('.js-prepaid-promo-code').click(function (event) { + var code = $(event.target).text(); + $('#promotional_code_promo_code').val(code); + return false; + }); +}) \ No newline at end of file diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 3c1eaa66..41ca8190 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1,3 +1,7 @@ .container-fluid { margin: 0 30px; } + +.force-word-wrap { + overflow-wrap: break-word; +} \ No newline at end of file diff --git a/app/authorizers/core_content_authorizer.rb b/app/authorizers/core_content_authorizer.rb index 0050fdf4..5d47581a 100644 --- a/app/authorizers/core_content_authorizer.rb +++ b/app/authorizers/core_content_authorizer.rb @@ -1,9 +1,10 @@ class CoreContentAuthorizer < ContentAuthorizer def self.creatable_by? user return false if ENV.key?('CONTENT_BLACKLIST') && ENV['CONTENT_BLACKLIST'].split(',').include?(user.email) - - [ - PermissionService.billing_plan_allows_core_content?(user: user) - ].any? + + return true # All billing plans support core content right now + # [ + # PermissionService.billing_plan_allows_core_content?(user: user) + # ].any? end end diff --git a/app/controllers/data_controller.rb b/app/controllers/data_controller.rb index 7c726153..9e165ae6 100644 --- a/app/controllers/data_controller.rb +++ b/app/controllers/data_controller.rb @@ -43,6 +43,12 @@ class DataController < ApplicationController @collaborating_universes = Universe.where(id: collaborating_ids) end + def referrals + @referrals = current_user.referrals.includes(:referree) + @referral_count = @referrals.count + @share_link = "https://www.notebook.ai/?referral=#{current_user.referral_code.code}" + end + private def set_sidenav_expansion diff --git a/app/controllers/page_collection_submissions_controller.rb b/app/controllers/page_collection_submissions_controller.rb index 0d21120a..ca3e069f 100644 --- a/app/controllers/page_collection_submissions_controller.rb +++ b/app/controllers/page_collection_submissions_controller.rb @@ -46,8 +46,14 @@ class PageCollectionSubmissionsController < ApplicationController # DELETE /page_collection_submissions/1 def destroy + unless user_signed_in? && current_user == @page_collection_submission.page_collection.user + raise "Not allowed" + return + end + + page_collection = @page_collection_submission.page_collection @page_collection_submission.destroy - redirect_to page_collection_submissions_url, notice: 'Page collection submission was successfully destroyed.' + redirect_to page_collection, notice: 'The page was successfully removed from this collection.' end def approve diff --git a/app/controllers/page_collections_controller.rb b/app/controllers/page_collections_controller.rb index 74647d09..ba13c0ad 100644 --- a/app/controllers/page_collections_controller.rb +++ b/app/controllers/page_collections_controller.rb @@ -79,6 +79,11 @@ class PageCollectionsController < ApplicationController # DELETE /page_collections/1 def destroy + unless user_signed_in? && current_user == @page_collection.user + raise "Permission denied" + return + end + @page_collection.destroy redirect_to page_collections_url, notice: 'Page collection was successfully destroyed.' end @@ -113,6 +118,27 @@ class PageCollectionsController < ApplicationController redirect_to root_path, notice: "That Collection has been reported to site administration. Thank you!" end + def by_user + @page_collection = PageCollection.find(params[:page_collection_id]) + + unless (@page_collection.privacy == 'public' || (user_signed_in? && @page_collection.user == current_user)) + return redirect_to page_collections_path, notice: "That Collection is not public." + end + + @pages = @page_collection.accepted_submissions.where(user_id: params[:user_id]) + sort_pages + + @submittable_content = if user_signed_in? + @current_user_content.slice(*@page_collection.page_types) + else + [] + end + + @show_contributor_highlight = true + @highlighted_contributor = User.find_by(id: params[:user_id].to_i) + render :show + end + private # Use callbacks to share common setup or constraints between actions. diff --git a/app/controllers/stream_controller.rb b/app/controllers/stream_controller.rb index 0f4ef488..29c1c570 100644 --- a/app/controllers/stream_controller.rb +++ b/app/controllers/stream_controller.rb @@ -3,6 +3,7 @@ class StreamController < ApplicationController before_action :set_stream_navbar_actions, only: [:index, :global] before_action :set_stream_navbar_color, only: [:index, :global] before_action :set_sidenav_expansion + before_action :cache_linkable_content_for_each_content_type, only: [:index] def index followed_users = current_user.followed_users.pluck(:id) diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb index fd18d658..6169aae6 100644 --- a/app/controllers/subscriptions_controller.rb +++ b/app/controllers/subscriptions_controller.rb @@ -122,12 +122,6 @@ class SubscriptionsController < ApplicationController end end - def referrals - @referrals = current_user.referrals.includes(:referree) - @referral_count = @referrals.count - @share_link = "https://www.notebook.ai/?referral=#{current_user.referral_code.code}" - end - # This isn't actually needed since we change the paid plan to the free plan, but will be needed when we # add a way to deactivate/delete accounts, so the logic is here for when it's needed. # def cancel @@ -286,9 +280,6 @@ class SubscriptionsController < ApplicationController }, { label: "Billing history", href: main_app.billing_history_path - }, { - label: "Referrals", - href: main_app.referrals_path }] end end diff --git a/app/models/paypal_invoice.rb b/app/models/billing/paypal_invoice.rb similarity index 56% rename from app/models/paypal_invoice.rb rename to app/models/billing/paypal_invoice.rb index 4a664cca..4b12da61 100644 --- a/app/models/paypal_invoice.rb +++ b/app/models/billing/paypal_invoice.rb @@ -1,4 +1,6 @@ class PaypalInvoice < ApplicationRecord + acts_as_paranoid + belongs_to :user belongs_to :page_unlock_promo_code, optional: true @@ -26,32 +28,11 @@ class PaypalInvoice < ApplicationRecord code: 'PP-' + (0...8).map { (65 + rand(26)).chr }.join + '-' + (0...8).map { (65 + rand(26)).chr }.join, page_types: Rails.application.config.content_types[:premium].map(&:name), uses_remaining: 1, - days_active: 30 * self.months.to_i, + days_active: 31 * self.months.to_i, internal_description: "Prepaid with PayPal", description: "Prepaid Premium subscription" ) self.save! - - if PromoService.active?(:promo_bogo) && (self.months == 3 || self.months == 6) - # During this promo, we create a separate Invoice + PromoCode also - self.user.paypal_invoices.create( - paypal_id: "None -- Created from promo_bogo promo", - status: self.status, - user_id: self.user_id, - months: self.months, - amount_cents: 0, - page_unlock_promo_code: PageUnlockPromoCode.create( - code: 'BOGO-' + (0...8).map { (65 + rand(26)).chr }.join + '-' + (0...8).map { (65 + rand(26)).chr }.join, - page_types: Rails.application.config.content_types[:premium].map(&:name), - uses_remaining: 1, - days_active: 30 * self.months.to_i, - internal_description: "promo_bogo duplicate code", - description: "Your free buy-one-get-one-free Premium Code", - ), - approval_url: nil, - payer_id: self.payer_id - ) - end end def activateable? diff --git a/app/models/page_collection.rb b/app/models/page_collections/page_collection.rb similarity index 98% rename from app/models/page_collection.rb rename to app/models/page_collections/page_collection.rb index a93addb0..062219b5 100644 --- a/app/models/page_collection.rb +++ b/app/models/page_collections/page_collection.rb @@ -1,4 +1,6 @@ class PageCollection < ApplicationRecord + acts_as_paranoid + belongs_to :user has_many :page_collection_submissions diff --git a/app/models/page_collection_following.rb b/app/models/page_collections/page_collection_following.rb similarity index 100% rename from app/models/page_collection_following.rb rename to app/models/page_collections/page_collection_following.rb diff --git a/app/models/page_collection_report.rb b/app/models/page_collections/page_collection_report.rb similarity index 100% rename from app/models/page_collection_report.rb rename to app/models/page_collections/page_collection_report.rb diff --git a/app/models/page_collection_submission.rb b/app/models/page_collections/page_collection_submission.rb similarity index 99% rename from app/models/page_collection_submission.rb rename to app/models/page_collections/page_collection_submission.rb index 7e905e24..471c7fa6 100644 --- a/app/models/page_collection_submission.rb +++ b/app/models/page_collections/page_collection_submission.rb @@ -1,4 +1,6 @@ class PageCollectionSubmission < ApplicationRecord + acts_as_paranoid + belongs_to :content, polymorphic: true belongs_to :page_collection belongs_to :user diff --git a/app/models/page_groupers/page_grouper.rb b/app/models/page_groupers/page_grouper.rb new file mode 100644 index 00000000..c1377268 --- /dev/null +++ b/app/models/page_groupers/page_grouper.rb @@ -0,0 +1,7 @@ +class PageGrouper < ApplicationRecord + self.abstract_class = true + + include HasContentLinking + + belongs_to :user, optional: true +end \ No newline at end of file diff --git a/app/models/planet_continent.rb b/app/models/page_groupers/planet_continent.rb similarity index 100% rename from app/models/planet_continent.rb rename to app/models/page_groupers/planet_continent.rb diff --git a/app/models/content_page_share.rb b/app/models/stream/content_page_share.rb similarity index 97% rename from app/models/content_page_share.rb rename to app/models/stream/content_page_share.rb index a367ff3f..4d4e08bf 100644 --- a/app/models/content_page_share.rb +++ b/app/models/stream/content_page_share.rb @@ -1,4 +1,6 @@ class ContentPageShare < ApplicationRecord + acts_as_paranoid + belongs_to :user belongs_to :content_page, polymorphic: true, optional: true belongs_to :secondary_content_page, polymorphic: true, optional: true diff --git a/app/models/content_page_share_following.rb b/app/models/stream/content_page_share_following.rb similarity index 100% rename from app/models/content_page_share_following.rb rename to app/models/stream/content_page_share_following.rb diff --git a/app/models/content_page_share_report.rb b/app/models/stream/content_page_share_report.rb similarity index 100% rename from app/models/content_page_share_report.rb rename to app/models/stream/content_page_share_report.rb diff --git a/app/models/share_comment.rb b/app/models/stream/share_comment.rb similarity index 89% rename from app/models/share_comment.rb rename to app/models/stream/share_comment.rb index 702b8486..8f790e19 100644 --- a/app/models/share_comment.rb +++ b/app/models/stream/share_comment.rb @@ -1,4 +1,6 @@ class ShareComment < ApplicationRecord + acts_as_paranoid + belongs_to :user, optional: true belongs_to :content_page_share diff --git a/app/models/attribute_category_suggestion.rb b/app/models/suggestions/attribute_category_suggestion.rb similarity index 100% rename from app/models/attribute_category_suggestion.rb rename to app/models/suggestions/attribute_category_suggestion.rb diff --git a/app/models/attribute_field_suggestion.rb b/app/models/suggestions/attribute_field_suggestion.rb similarity index 100% rename from app/models/attribute_field_suggestion.rb rename to app/models/suggestions/attribute_field_suggestion.rb diff --git a/app/models/timeline.rb b/app/models/timelines/timeline.rb similarity index 100% rename from app/models/timeline.rb rename to app/models/timelines/timeline.rb diff --git a/app/models/timeline_event.rb b/app/models/timelines/timeline_event.rb similarity index 93% rename from app/models/timeline_event.rb rename to app/models/timelines/timeline_event.rb index 4b886ae6..fc68f032 100644 --- a/app/models/timeline_event.rb +++ b/app/models/timelines/timeline_event.rb @@ -1,4 +1,6 @@ class TimelineEvent < ApplicationRecord + acts_as_paranoid + belongs_to :timeline has_many :timeline_event_entities, dependent: :destroy diff --git a/app/models/timeline_event_entity.rb b/app/models/timelines/timeline_event_entity.rb similarity index 100% rename from app/models/timeline_event_entity.rb rename to app/models/timelines/timeline_event_entity.rb diff --git a/app/models/notice_dismissal.rb b/app/models/users/notice_dismissal.rb similarity index 100% rename from app/models/notice_dismissal.rb rename to app/models/users/notice_dismissal.rb diff --git a/app/models/notification.rb b/app/models/users/notification.rb similarity index 100% rename from app/models/notification.rb rename to app/models/users/notification.rb diff --git a/app/models/page_settings_override.rb b/app/models/users/page_settings_override.rb similarity index 100% rename from app/models/page_settings_override.rb rename to app/models/users/page_settings_override.rb diff --git a/app/models/user_blocking.rb b/app/models/users/user_blocking.rb similarity index 100% rename from app/models/user_blocking.rb rename to app/models/users/user_blocking.rb diff --git a/app/models/user_following.rb b/app/models/users/user_following.rb similarity index 100% rename from app/models/user_following.rb rename to app/models/users/user_following.rb diff --git a/app/views/content/_share.html.erb b/app/views/content/_share.html.erb index 51276c63..8d835096 100644 --- a/app/views/content/_share.html.erb +++ b/app/views/content/_share.html.erb @@ -16,6 +16,13 @@
- <%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'blue-text lighten-1', target: '_new' do %> - Click here to learn more about sharing pages on Notebook.ai - <% end %> -
+ +- <%= simple_format share.message %> ++ <%= + simple_format ContentFormatterService.show( + text: share.message, + viewing_user: current_user + ) + %><% end %> diff --git a/app/views/content_page_shares/_stream_page_share.html.erb b/app/views/content_page_shares/_stream_page_share.html.erb index 71aff342..b2752486 100644 --- a/app/views/content_page_shares/_stream_page_share.html.erb +++ b/app/views/content_page_shares/_stream_page_share.html.erb @@ -47,8 +47,13 @@ <%= link_to [share.user, share] do %><%= time_ago_in_words share.shared_at %> ago<% end %>: -- <%= simple_format share.message %> ++ <%= + simple_format ContentFormatterService.show( + text: share.message, + viewing_user: current_user + ) + %><% end %> diff --git a/app/views/content_page_shares/show.html.erb b/app/views/content_page_shares/show.html.erb index f6f7f67d..e8bac02a 100644 --- a/app/views/content_page_shares/show.html.erb +++ b/app/views/content_page_shares/show.html.erb @@ -66,27 +66,34 @@ -- -@@ -102,8 +109,13 @@ <% if @share.message.present? %> -+- <%= simple_format @share.message %> ++ <%= + simple_format ContentFormatterService.show( + text: @share.message, + viewing_user: current_user + ) + %><% end %> diff --git a/app/views/data/index.html.erb b/app/views/data/index.html.erb index 8c24a550..c5fb24ab 100644 --- a/app/views/data/index.html.erb +++ b/app/views/data/index.html.erb @@ -69,6 +69,20 @@ <% end %>+ <%= link_to referrals_path, class: 'black-text' do %> ++++ <% end %> ++ favorite ++Referrals++ Get your referral code, browse potential rewards, and invite your friends! +
+<%= link_to discussions_path, class: 'black-text' do %>diff --git a/app/views/subscriptions/referrals.html.erb b/app/views/data/referrals.html.erb similarity index 100% rename from app/views/subscriptions/referrals.html.erb rename to app/views/data/referrals.html.erb diff --git a/app/views/data/uploads.html.erb b/app/views/data/uploads.html.erb index 2ee22972..04c8c8f6 100644 --- a/app/views/data/uploads.html.erb +++ b/app/views/data/uploads.html.erb @@ -31,9 +31,9 @@--<% end %> \ No newline at end of file +<% end %> + +<%= render partial: 'javascripts/content_linking' %> \ No newline at end of file diff --git a/app/views/subscriptions/new.html.erb b/app/views/subscriptions/new.html.erb index 47416d35..459c4150 100644 --- a/app/views/subscriptions/new.html.erb +++ b/app/views/subscriptions/new.html.erb @@ -239,8 +239,7 @@+diff --git a/app/views/page_collections/_stream.html.erb b/app/views/page_collections/_stream.html.erb index 46eb0432..4f28ad74 100644 --- a/app/views/page_collections/_stream.html.erb +++ b/app/views/page_collections/_stream.html.erb @@ -11,6 +11,21 @@Did you know? - Premium users get an extra 10GB of storage space, but all users can earn even more storage space by referring their friends to Notebook.ai. + Premium users get an extra 10GB of storage space, but you can earn even more storage space by referring friends to Notebook.ai. <%= link_to 'Learn more.', referrals_path, class: 'orange-text text-lighten-3' %><%= link_to content.name, content %> + + <% if user_signed_in? && current_user == @page_collection.user %> + + more_vert + +<% if page.explanation? %>+
+ <% end %>- + <%= link_to 'All pages from this user', page_collection_submissions_by_user_path(page_collection_id: @page_collection.id, user_id: page.user_id) %> +
+ +- + <%= link_to 'Remove from collection', page_collection_submission_path(page), method: :delete %> +
+diff --git a/app/views/page_collections/show.html.erb b/app/views/page_collections/show.html.erb index 26280773..77c0bbdd 100644 --- a/app/views/page_collections/show.html.erb +++ b/app/views/page_collections/show.html.erb @@ -10,9 +10,14 @@<% else %> <%= render partial: 'page_collections/sort_bar' %> + <% if !!@show_contributor_highlight %> ++ Showing all submitted pages from <%= link_to @highlighted_contributor.display_name, @highlighted_contributor, class: "#{User.color}-text" %>. + Click <%= link_to 'here', @page_collection, class: 'blue-text text-lighten-3' %> to see all pages regardless of author. ++ <% end %> + <%= render partial: 'page_collections/stream', locals: { pages: @pages } %> <% end %> - - <%= render partial: 'page_collections/stream', locals: { pages: @pages } %><%= render partial: 'page_collections/sidebar' %> diff --git a/app/views/share_comments/_form.html.erb b/app/views/share_comments/_form.html.erb index bdadf8b8..753b0522 100644 --- a/app/views/share_comments/_form.html.erb +++ b/app/views/share_comments/_form.html.erb @@ -1,8 +1,8 @@ <%= form_for ShareComment.new do |f| %>- <%= f.label :message, 'Leave a message' %> <%= f.hidden_field :content_page_share_id, value: share.id %> - <%= f.text_area :message, class: 'materialize-textarea' %> + <%= f.label 'Leave a message', for: "share_comment_#{share.id}" %> + <%= f.text_area :message, id: "share_comment_#{share.id}", class: 'materialize-textarea js-can-mention-pages' %> <%= f.submit 'Comment', class: 'btn right green white-text submit-button' %><% end %> \ No newline at end of file diff --git a/app/views/share_comments/_show.html.erb b/app/views/share_comments/_show.html.erb index a4666022..ef7d94a4 100644 --- a/app/views/share_comments/_show.html.erb +++ b/app/views/share_comments/_show.html.erb @@ -7,7 +7,10 @@ <% end %> <%# Nesting from above %> - <%= simple_format comment.message, class: 'black-text' %> + <%= simple_format ContentFormatterService.show( + text: comment.message, + viewing_user: current_user + ), class: 'black-text' %>+-@@ -309,7 +308,7 @@<% current_user.page_unlock_promo_codes.where('uses_remaining > 0').each do |code| %> -
<% end %> @@ -363,31 +362,6 @@- <%= code.code %> (<%= code.description %>)
+- <%= code.code %> (<%= code.description %>)
<% end %>--------- Upload Bandwidth --- <%= (current_user.upload_bandwidth_kb) > 0 ? Filesize.from("#{current_user.upload_bandwidth_kb}KB").pretty : '-' + Filesize.from("#{current_user.upload_bandwidth_kb.abs}KB").pretty %> remaining --- You have <%= (current_user.upload_bandwidth_kb) > 0 ? Filesize.from("#{current_user.upload_bandwidth_kb}KB").pretty : '-' + Filesize.from("#{current_user.upload_bandwidth_kb.abs}KB").pretty %> of bandwidth remaining. -
-- This bandwidth can be used to upload images to your content anywhere on the site. Deleting an uploaded image frees - up the same amount of bandwidth. - <% unless on_premium_plan %> - To get more bandwidth, upgrade to our Premium plan. - <% end %> -
-All prices are in US Dollars. Making payments using another currency will automatically exchange into US Dollars at the current exchange rates.\ No newline at end of file diff --git a/app/views/subscriptions/prepay.html.erb b/app/views/subscriptions/prepay.html.erb index 387ed79a..2c2b9058 100644 --- a/app/views/subscriptions/prepay.html.erb +++ b/app/views/subscriptions/prepay.html.erb @@ -60,7 +60,7 @@<%= link_to prepay_paypal_gateway_path(months: 3), class: 'black-text' do %> -+star @@ -77,7 +77,7 @@<%= link_to prepay_paypal_gateway_path(months: 6), class: 'black-text' do %> -+star @@ -126,7 +126,7 @@ <% if current_user.on_premium_plan? && @invoices.any? %> -+Since you already have Premium features active, you won't be able to activate any codes on this account yet.diff --git a/app/views/users/profile/_info.html.erb b/app/views/users/profile/_info.html.erb index 6b0906f8..6f852a8d 100644 --- a/app/views/users/profile/_info.html.erb +++ b/app/views/users/profile/_info.html.erb @@ -51,7 +51,7 @@
Activation links will appear again whenever you don't have Premium active.Username-+<%= link_to "@#{@user.username}", profile_by_username_path(username: @user.username) %>
@@ -61,7 +61,7 @@Also known as-+<%= @user.other_names %>
@@ -76,7 +76,7 @@Website-+<%= link_to @user.website, @user.website, target: '_new', data: { confirm: "You are about to visit an external website not owned by Notebook.ai. Please only continue if you trust this user." }, ref: 'nofollow' %>
@@ -111,7 +111,7 @@Bio-+@@ -126,7 +126,7 @@<%= simple_format truncate(@user.bio, length: 500) %><%= field.titleize %>-+diff --git a/config/routes.rb b/config/routes.rb index 4852c61f..02822aea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,8 @@ Rails.application.routes.draw do get 'follow', on: :member get 'unfollow', on: :member get 'report', on: :member + + get 'by/:user_id', to: 'page_collections#by_user', as: :submissions_by_user end resources :page_collection_submissions do get 'approve', on: :member @@ -86,12 +88,13 @@ Rails.application.routes.draw do # Legacy route: left intact so /my/documents/X URLs continue to work for everyone's bookmarks resources :documents + get '/referrals', to: 'data#referrals', as: :referrals + # Billing scope '/billing' do #get '/', to: 'subscriptions#show', as: :billing get '/subscription', to: 'subscriptions#new', as: :subscription get '/history', to: 'subscriptions#history', as: :billing_history - get '/referrals', to: 'subscriptions#referrals', as: :referrals get '/to/:stripe_plan_id', to: 'subscriptions#change', as: :change_subscription diff --git a/db/migrate/20200829011900_add_paranoid_fields_to_recent_models.rb b/db/migrate/20200829011900_add_paranoid_fields_to_recent_models.rb new file mode 100644 index 00000000..5adc0c03 --- /dev/null +++ b/db/migrate/20200829011900_add_paranoid_fields_to_recent_models.rb @@ -0,0 +1,8 @@ +class AddParanoidFieldsToRecentModels < ActiveRecord::Migration[6.0] + def change + add_column :page_collections, :deleted_at, :datetime + add_column :page_collection_submissions, :deleted_at, :datetime + add_column :paypal_invoices, :deleted_at, :datetime + add_column :timeline_events, :deleted_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index f4ff1ade..2aeb90eb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_07_22_004641) do +ActiveRecord::Schema.define(version: 2020_08_29_011900) do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false @@ -41,6 +41,24 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.index ["user_id"], name: "index_api_keys_on_user_id" end + create_table "application_integrations", force: :cascade do |t| + t.integer "user_id", null: false + t.string "name" + t.string "description" + t.string "organization_name" + t.string "organization_url" + t.string "website_url" + t.string "privacy_policy_url" + t.string "token" + t.datetime "last_used_at" + t.string "authorization_callback_url" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "event_ping_url" + t.string "application_token" + t.index ["user_id"], name: "index_application_integrations_on_user_id" + end + create_table "archenemyships", force: :cascade do |t| t.integer "user_id" t.integer "character_id" @@ -1421,6 +1439,17 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.index ["user_id"], name: "index_image_uploads_on_user_id" end + create_table "integration_authorizations", force: :cascade do |t| + t.integer "user_id", null: false + t.integer "application_integration_id", null: false + t.string "referral_url" + t.string "ip_address" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["application_integration_id"], name: "index_integration_authorizations_on_application_integration_id" + t.index ["user_id"], name: "index_integration_authorizations_on_user_id" + end + create_table "item_magics", force: :cascade do |t| t.integer "item_id" t.integer "magic_id" @@ -2168,6 +2197,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.datetime "updated_at", precision: 6, null: false t.string "explanation" t.string "cached_content_name" + t.datetime "deleted_at" t.index ["content_type", "content_id"], name: "polycontent_collection_index" t.index ["page_collection_id"], name: "index_page_collection_submissions_on_page_collection_id" t.index ["user_id"], name: "index_page_collection_submissions_on_user_id" @@ -2187,6 +2217,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.string "description" t.boolean "allow_submissions" t.string "slug" + t.datetime "deleted_at" t.index ["user_id"], name: "index_page_collections_on_user_id" end @@ -2243,6 +2274,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.integer "page_unlock_promo_code_id" t.string "approval_url" t.string "payer_id" + t.datetime "deleted_at" t.index ["page_unlock_promo_code_id"], name: "index_paypal_invoices_on_page_unlock_promo_code_id" t.index ["user_id"], name: "index_paypal_invoices_on_user_id" end @@ -3111,6 +3143,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.integer "position" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false + t.datetime "deleted_at" t.index ["timeline_id"], name: "index_timeline_events_on_timeline_id" end @@ -3402,6 +3435,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "api_keys", "users" + add_foreign_key "application_integrations", "users" add_foreign_key "buildings", "universes" add_foreign_key "buildings", "users" add_foreign_key "character_birthtowns", "characters" @@ -3561,6 +3595,8 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do add_foreign_key "group_creatures", "groups" add_foreign_key "group_creatures", "users" add_foreign_key "image_uploads", "users" + add_foreign_key "integration_authorizations", "application_integrations" + add_foreign_key "integration_authorizations", "users" add_foreign_key "item_magics", "items" add_foreign_key "item_magics", "magics" add_foreign_key "item_magics", "users"<%= simple_format @user.send(field) %>