From c5e3d495bb9fd594a7d46a0c86455c32f813cb1b Mon Sep 17 00:00:00 2001 From: Emanuel Hayford Date: Tue, 14 Mar 2017 04:51:26 +0100 Subject: [PATCH 1/3] Add some tips to installation guide --- INSTALL.md | 30 ++++++++++++++++++++++-------- PAYMENTS.md | 8 ++++---- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 7bc85350..2a851ba4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,8 +1,22 @@ # Install Open Source Event Manager -All the information that you need to install OSEM. If you have any problems with installing don't hesitate to [contact us](https://github.com/openSUSE/osem#contact) +This file contains all the information you need to install OSEM. If you run into any problems, do not hesitate to [contact us](https://github.com/openSUSE/osem#contact). + +If you encounter +``` +An error occurred while installing yajl-ruby (1.2.0), and Bundler cannot continue. +Make sure that `gem install yajl-ruby -v '1.2.0'` succeeds before bundling. +``` +or + +``` +An error occurred while installing json (1.8.3), and Bundler cannot continue. +Make sure that `gem install json -v '1.8.3'` succeeds before bundling. +``` + +check that your Ruby version is not greater than `ruby-2.3.3`. ## Versions -OSEM is an [semantic versioned](http://semver.org/) app. That means given a version number MAJOR.MINOR.PATCH we increment the: +OSEM is a [semantic versioned](http://semver.org/) app. That means given a version number MAJOR.MINOR.PATCH we increment the: 1. MAJOR version when we make incompatible changes, 2. MINOR version when we add functionality in a backwards-compatible manner @@ -12,13 +26,13 @@ OSEM is an [semantic versioned](http://semver.org/) app. That means given a vers You can find the latest OSEM releases on our [release page](https://github.com/openSUSE/osem/releases/latest) ([older release here](https://github.com/openSUSE/osem/releases)) ## Deploy -OSEM is a *Ruby on Rails* application. We recommend to run OSEM in production with [mod_passenger](https://www.phusionpassenger.com/download/#open_source) +OSEM is a *Ruby on Rails* application. We recommend you run OSEM in production with [mod_passenger](https://www.phusionpassenger.com/download/#open_source) and the [apache web-server](https://www.apache.org/). There are tons of guides on how to deploy rails apps on various base operating systems. [Check Google](https://encrypted.google.com/search?hl=en&q=ruby%20on%20rails%20apache%20passenger) ;-) -For more information about rails and what it can do, see the [rails guides.](http://guides.rubyonrails.org/getting_started.html) +For more information about Fails and what it can do, see the [Fails Guides.](http://guides.rubyonrails.org/getting_started.html) -If you have an heroku account you can also +If you have a Heroku account you can also Deploy @@ -55,8 +69,8 @@ There are a couple of environment variables you can set to configure OSEM. | STRIPE_SECRET_KEY | *string* | Secret Key for Stripe Gateway ### Online Ticket Payments -We use [Stripe](https://stripe.com) for accepting your ticket payments securely over the web. -Our application uses iFrame for accepting your user's payment details without storing them, making the application PCI SAQ-A Compliant. +We use [Stripe](https://stripe.com) for accepting ticket payments securely over the web. +Our application uses iFrame for accepting your users' payment details without storing them, making the application PCI SAQ-A Compliant. Please refer to [PAYMENTS](PAYMENTS.md) documentation file for setting up your stripe account and start accepting payments from your users. ## Dependencies @@ -74,7 +88,7 @@ In order to use [openID](http://openid.net/) logins for your OSEM installation y ## Recurring Jobs ======= -Open a separate terminal and go into the directory where the rails app is present, and type the following to start the delayed_jobs worker for sending email notifications. +Open a separate terminal and go into the directory where the Rails app is present, and type the following to start the delayed_jobs worker for sending email notifications. ``` bundle exec rake jobs:work ``` diff --git a/PAYMENTS.md b/PAYMENTS.md index ea1d515b..d835e1c0 100644 --- a/PAYMENTS.md +++ b/PAYMENTS.md @@ -1,5 +1,5 @@ # Integrate your Stripe account to accept your user's payments -Here you will find all the information that you need to setup your Stripe account into OSEM. +Here you will find all the information you need to setup your Stripe account into OSEM. If you have any problems with installing don't hesitate to [contact us](https://github.com/openSUSE/osem#contact) ## Configure Stripe into the application @@ -25,9 +25,9 @@ You can test the payment feature in development mode with some test cards. Check out the list of test cards [here](https://stripe.com/docs/testing#cards). ### PCI Self Assessment Questionnaire(SAQ) -> As long as you serve your payment pages over TLS, and use either Checkout or Stripe.js -> as the only way of handling card information, Stripe automatically creates a prefilled SAQ A questionnaire for you, -> and you won’t need to undergo a PCI audit. If card data is stored or transferred through your servers, +> As long as you serve your payment pages over TLS, and use either Checkout or Stripe.js +> as the only way of handling card information, Stripe automatically creates a prefilled SAQ A questionnaire for you, +> and you won’t need to undergo a PCI audit. If card data is stored or transferred through your servers, > you are responsible for following PCI DSS guidelines for handling card data, and periodic audits by a PCI-certified auditor. As we are using Stripe Checkout for accepting payments, Stripe will help you for filling SAQ for your application. From 33df0ee8e45a70bf4a4bd79b800a7eb679ba9885 Mon Sep 17 00:00:00 2001 From: Emanuel Hayford Date: Thu, 16 Mar 2017 06:41:15 +0100 Subject: [PATCH 2/3] Fixes #1230. Makes comment counter more efficient --- 0 | 2 ++ app/models/comment.rb | 2 +- app/views/admin/events/index.html.haml | 2 +- .../20170316042351_add_comment_count_to_events.rb | 15 +++++++++++++++ db/schema.rb | 3 ++- 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 0 create mode 100644 db/migrate/20170316042351_add_comment_count_to_events.rb diff --git a/0 b/0 new file mode 100644 index 00000000..b8bb5159 --- /dev/null +++ b/0 @@ -0,0 +1,2 @@ + invoke active_record + create db/migrate/20170316042351_add_comment_count_to_events.rb diff --git a/app/models/comment.rb b/app/models/comment.rb index 31531f8e..8c915974 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -8,7 +8,7 @@ class Comment < ActiveRecord::Base # want user to vote on the quality of comments. #acts_as_votable - belongs_to :commentable, polymorphic: true + belongs_to :commentable, polymorphic: true, counter_cache: true # NOTE: Comments belong to a user belongs_to :user diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 16110268..bd02e73e 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -183,4 +183,4 @@ %ul.dropdown-menu{role: 'menu'} = render 'change_state_dropdown', event: event %td.text-center - = link_to "#{event.comment_threads.count}", admin_conference_program_event_path(@conference.short_title, event), anchor: 'comments-div' + = link_to "#{event.comments_count}", admin_conference_program_event_path(@conference.short_title, event), anchor: 'comments-div' diff --git a/db/migrate/20170316042351_add_comment_count_to_events.rb b/db/migrate/20170316042351_add_comment_count_to_events.rb new file mode 100644 index 00000000..762fa882 --- /dev/null +++ b/db/migrate/20170316042351_add_comment_count_to_events.rb @@ -0,0 +1,15 @@ +class AddCommentCountToEvents < ActiveRecord::Migration + def up + add_column :events, :comments_count, :integer, default: 0 + + Event.reset_column_information + + Event.find_each do |event| + event.update_attribute :comments_count, event.comment_threads.length + end + end + + def down + remove_column :events, :comments_count + end +end diff --git a/db/schema.rb b/db/schema.rb index 34c30a04..458d218a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170213145807) do +ActiveRecord::Schema.define(version: 20170316042351) do create_table "ahoy_events", force: :cascade do |t| t.uuid "visit_id", limit: 16 @@ -234,6 +234,7 @@ ActiveRecord::Schema.define(version: 20170213145807) do t.boolean "is_highlight", default: false t.integer "program_id" t.integer "max_attendees" + t.integer "comments_count", default: 0 end create_table "events_registrations", force: :cascade do |t| From 4ef78e2b9da4cb0200b2ec6095bd0047f273b85f Mon Sep 17 00:00:00 2001 From: Emanuel Hayford Date: Thu, 16 Mar 2017 06:55:34 +0100 Subject: [PATCH 3/3] Restore previously modified files with minor fixes --- INSTALL.md | 28 +++++++--------------------- PAYMENTS.md | 6 +++--- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 2a851ba4..3de309dd 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,22 +1,8 @@ # Install Open Source Event Manager -This file contains all the information you need to install OSEM. If you run into any problems, do not hesitate to [contact us](https://github.com/openSUSE/osem#contact). - -If you encounter -``` -An error occurred while installing yajl-ruby (1.2.0), and Bundler cannot continue. -Make sure that `gem install yajl-ruby -v '1.2.0'` succeeds before bundling. -``` -or - -``` -An error occurred while installing json (1.8.3), and Bundler cannot continue. -Make sure that `gem install json -v '1.8.3'` succeeds before bundling. -``` - -check that your Ruby version is not greater than `ruby-2.3.3`. +All the information that you need to install OSEM. If you have any problems with installing don't hesitate to [contact us](https://github.com/openSUSE/osem#contact) ## Versions -OSEM is a [semantic versioned](http://semver.org/) app. That means given a version number MAJOR.MINOR.PATCH we increment the: +OSEM is an [semantic versioned](http://semver.org/) app. That means given a version number MAJOR.MINOR.PATCH we increment the: 1. MAJOR version when we make incompatible changes, 2. MINOR version when we add functionality in a backwards-compatible manner @@ -26,11 +12,11 @@ OSEM is a [semantic versioned](http://semver.org/) app. That means given a versi You can find the latest OSEM releases on our [release page](https://github.com/openSUSE/osem/releases/latest) ([older release here](https://github.com/openSUSE/osem/releases)) ## Deploy -OSEM is a *Ruby on Rails* application. We recommend you run OSEM in production with [mod_passenger](https://www.phusionpassenger.com/download/#open_source) -and the [apache web-server](https://www.apache.org/). There are tons of guides on how to deploy rails apps on various +OSEM is a *Ruby on Rails* application. We recommend to run OSEM in production with [mod_passenger](https://www.phusionpassenger.com/download/#open_source) +and the [apache web-server](https://www.apache.org/). There are tons of guides on how to deploy Rails apps on various base operating systems. [Check Google](https://encrypted.google.com/search?hl=en&q=ruby%20on%20rails%20apache%20passenger) ;-) -For more information about Fails and what it can do, see the [Fails Guides.](http://guides.rubyonrails.org/getting_started.html) +For more information about Rails and what it can do, see the [Rails Guides.](http://guides.rubyonrails.org/getting_started.html) If you have a Heroku account you can also @@ -69,8 +55,8 @@ There are a couple of environment variables you can set to configure OSEM. | STRIPE_SECRET_KEY | *string* | Secret Key for Stripe Gateway ### Online Ticket Payments -We use [Stripe](https://stripe.com) for accepting ticket payments securely over the web. -Our application uses iFrame for accepting your users' payment details without storing them, making the application PCI SAQ-A Compliant. +We use [Stripe](https://stripe.com) for accepting your ticket payments securely over the web. +Our application uses iFrame for accepting your user's payment details without storing them, making the application PCI SAQ-A Compliant. Please refer to [PAYMENTS](PAYMENTS.md) documentation file for setting up your stripe account and start accepting payments from your users. ## Dependencies diff --git a/PAYMENTS.md b/PAYMENTS.md index d835e1c0..91ab0fba 100644 --- a/PAYMENTS.md +++ b/PAYMENTS.md @@ -1,5 +1,5 @@ # Integrate your Stripe account to accept your user's payments -Here you will find all the information you need to setup your Stripe account into OSEM. +Here you will find all the information that you need to setup your Stripe account into OSEM. If you have any problems with installing don't hesitate to [contact us](https://github.com/openSUSE/osem#contact) ## Configure Stripe into the application @@ -34,9 +34,9 @@ As we are using Stripe Checkout for accepting payments, Stripe will help you for You can read the full security documentation [here](https://stripe.com/docs/security). ## Configure Stripe to send emails for successful transactions -Stripe can send email reciepts for every successful payment done through its gateway. +Stripe can send email receipts for every successful payment done through its gateway. Please refer [here](https://dashboard.stripe.com/account/emails) to enable invoice emails for your users. ## Customize Stripe invoice emails for your application -You can customise your payment reciepts by adding your personalisation like organisation name, logo etc. +You can customise your payment receipts by adding your personalisation like organisation name, logo etc. Please see the options for invoice personalisation [here](https://dashboard.stripe.com/account/public).