Skip to content

Commit

Permalink
Merge 7c66bb0 into 00a98af
Browse files Browse the repository at this point in the history
  • Loading branch information
ramontayag committed Jul 9, 2018
2 parents 00a98af + 7c66bb0 commit baa9c9e
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 41 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH=./bin:$PATH
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Not Released

## Fixed
- Fix loading of jquery-ui files (Fixes https://github.com/mbulat/plutus/issues/58)

## Added
- Add `Account#amounts` and `Account#entries` to get all amounts and entries, respectively

## Changed
- Required jquery-ui version
- How migrations are done, which may be a breaking change from older versions of Plutus
4 changes: 1 addition & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Installation
============

- Add the gem to your Gemfile `gem "plutus"`

- generate migration files `rails g plutus`

- generate migration files `rake plutus:install:migrations`
- run migrations `rake db:migrate`

Overview
Expand Down
12 changes: 12 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/plutus/engine', __FILE__)

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

require 'rails/all'
require 'rails/engine/commands'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CreatePlutusTables < ActiveRecord::Migration[4.2]
def self.up
def change
create_table :plutus_accounts do |t|
t.string :name
t.string :type
Expand Down Expand Up @@ -30,10 +30,4 @@ def self.up
add_index :plutus_amounts, [:account_id, :entry_id]
add_index :plutus_amounts, [:entry_id, :account_id]
end

def self.down
drop_table :plutus_accounts
drop_table :plutus_entries
drop_table :plutus_amounts
end
end
2 changes: 1 addition & 1 deletion fixture_rails_root/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem "plutus", path: "~/repos/plutus"
gem "plutus", path: "../"
22 changes: 11 additions & 11 deletions fixture_rails_root/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
plutus (0.12.2)
plutus (0.13)
jquery-rails (>= 3.0)
jquery-ui-rails (>= 4.2.2)
kaminari (~> 1.0)
Expand Down Expand Up @@ -74,18 +74,18 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
kaminari (1.0.1)
kaminari (1.1.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
kaminari-activerecord (= 1.0.1)
kaminari-core (= 1.0.1)
kaminari-actionview (1.0.1)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
actionview
kaminari-core (= 1.0.1)
kaminari-activerecord (1.0.1)
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand Down Expand Up @@ -195,4 +195,4 @@ DEPENDENCIES
web-console (>= 3.3.0)

BUNDLED WITH
1.15.1
1.16.2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CreatePlutusTables < ActiveRecord::Migration[4.2]
def self.up
def change
create_table :plutus_accounts do |t|
t.string :name
t.string :type
Expand Down Expand Up @@ -30,10 +30,4 @@ def self.up
add_index :plutus_amounts, [:account_id, :entry_id]
add_index :plutus_amounts, [:entry_id, :account_id]
end

def self.down
drop_table :plutus_accounts
drop_table :plutus_entries
drop_table :plutus_amounts
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This migration comes from plutus (originally 20170611000000)
class UpdatePlutusTables < ActiveRecord::Migration[4.2]
def change
# we have to remove these indexes because the temporary
# table index name is too long
remove_index :plutus_amounts, [:account_id, :transaction_id]
remove_index :plutus_amounts, [:transaction_id, :account_id]
remove_index :plutus_transactions, column: [:commercial_document_id, :commercial_document_type], :name => "index_transactions_on_commercial_doc"

rename_table :plutus_transactions, :plutus_entries
rename_column :plutus_amounts, :transaction_id, :entry_id

# adding the indexes back
add_index :plutus_amounts, [:account_id, :entry_id]
add_index :plutus_amounts, [:entry_id, :account_id]
add_index :plutus_entries, [:commercial_document_id, :commercial_document_type], :name => "index_entries_on_commercial_doc"
end
end
6 changes: 0 additions & 6 deletions lib/generators/plutus/templates/add_date_migration.rb

This file was deleted.

7 changes: 2 additions & 5 deletions lib/plutus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
require "rails"

module Plutus
class Engine < Rails::Engine
isolate_namespace Plutus
end


# ------------------------------ tenancy ------------------------------
# configuration to enable or disable tenancy
mattr_accessor :enable_tenancy
Expand All @@ -21,3 +16,5 @@ def self.config
yield(self)
end
end

require "plutus/engine"
5 changes: 5 additions & 0 deletions lib/plutus/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Plutus
class Engine < Rails::Engine
isolate_namespace Plutus
end
end

0 comments on commit baa9c9e

Please sign in to comment.