Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  app
  config
  db
  lib
  spec
  README.md
  Rakefile
Size: Mime:
  README.md

Core

Codeship

This is a Rails Engine which provides the core (shared) functionality. This allows us to share commonly used components (like models, mailers, etc.) across the web-service, dashboard and other projects.

Usage

This is designed to be added as a gem to another Rails project. It's optional to mount the routes, but if necessary:

# config/routes.rb
Rails.application.routes.draw do
  mount Core::Engine => '/'
end

This will also make the route helpers available, which are used in certain operations. Odd errors will appear if these are used and not present. You should open an issue if this isn't expected.

Additionally, you should configure an initializer to configure settings. This should suffice:

# config/initializers/core_engine.rb
Core.configure do |config|
  config.stripe_token = ENV['STRIPE_TOKEN']
  config.opencage_geocoder = ENV['OPENCAGE_TOKEN']
end

Accessors & Helpers

  • Core.redis provides a shared Redis instance.

Models

  • Core::User
    • which has_many: Bookings
  • Core::Organisation
    • which has_many: Venues
  • Core::Venue
    • which belongs_to: Organisation
    • which has_many: Events, Instructors
  • Core::Event
    • which belongs_to: Venue
    • which has_many: ActivityTypes, Instructors
  • Core::Booking
    • which belongs_to: User, Event
  • Core::ActivityType
  • Core::Instructor
    • which belongs_to: Venue

Utils

  • Core::Utils::Payments: provides abstracted payment handling functionality.

Testing

Specs are provided by RSpec and aim to cover the whole project. To run:

bundle exec rspec

Maintainer