diff --git a/fixture_rails_root/db/migrate/20101203193439_create_plutus_tables.rb b/fixture_rails_root/db/migrate/20101203193439_create_plutus_tables.rb index 729fb441..0dedc163 100644 --- a/fixture_rails_root/db/migrate/20101203193439_create_plutus_tables.rb +++ b/fixture_rails_root/db/migrate/20101203193439_create_plutus_tables.rb @@ -1,16 +1,16 @@ class CreatePlutusTables < ActiveRecord::Migration def self.up - create_table :accounts do |t| + create_table :plutus_accounts do |t| t.string :name t.string :type t.boolean :contra t.timestamps end - - add_index :accounts, [:name, :type] - - create_table :transactions do |t| + + add_index :plutus_accounts, [:name, :type] + + create_table :plutus_transactions do |t| t.string :description t.integer :credit_account_id t.integer :debit_account_id @@ -21,13 +21,13 @@ def self.up t.timestamps end - add_index :transactions, :credit_account_id - add_index :transactions, :debit_account_id - add_index :transactions, [:commercial_document_id, :commercial_document_type], :name => "index_transactions_on_commercial_doc" + add_index :plutus_transactions, :credit_account_id + add_index :plutus_transactions, :debit_account_id + add_index :plutus_transactions, [:commercial_document_id, :commercial_document_type], :name => "plutus_ts_on_commercial_doc" end def self.down - drop_table :accounts - drop_table :transactions + drop_table :plutus_accounts + drop_table :plutus_transactions end end diff --git a/fixture_rails_root/db/schema.rb b/fixture_rails_root/db/schema.rb index d1ae71c8..62eda3b8 100644 --- a/fixture_rails_root/db/schema.rb +++ b/fixture_rails_root/db/schema.rb @@ -10,31 +10,31 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20101203185848) do +ActiveRecord::Schema.define(:version => 20120307201016) do - create_table "accounts", :force => true do |t| + create_table "plutus_accounts", :force => true do |t| t.string "name" t.string "type" t.boolean "contra" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end - add_index "accounts", ["name", "type"], :name => "index_accounts_on_name_and_type" + add_index "plutus_accounts", ["name", "type"], :name => "index_plutus_accounts_on_name_and_type" - create_table "transactions", :force => true do |t| + create_table "plutus_transactions", :force => true do |t| t.string "description" t.integer "credit_account_id" t.integer "debit_account_id" t.decimal "amount", :precision => 20, :scale => 10 t.integer "commercial_document_id" t.string "commercial_document_type" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end - add_index "transactions", ["commercial_document_id", "commercial_document_type"], :name => "index_transactions_on_commercial_doc" - add_index "transactions", ["credit_account_id"], :name => "index_transactions_on_credit_account_id" - add_index "transactions", ["debit_account_id"], :name => "index_transactions_on_debit_account_id" + add_index "plutus_transactions", ["commercial_document_id", "commercial_document_type"], :name => "plutus_ts_on_commercial_doc" + add_index "plutus_transactions", ["credit_account_id"], :name => "index_plutus_transactions_on_credit_account_id" + add_index "plutus_transactions", ["debit_account_id"], :name => "index_plutus_transactions_on_debit_account_id" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ab6e94e5..f907f7dc 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,15 +1,15 @@ require 'factory_girl' - ENV["RAILS_ENV"] ||= 'test' - require File.expand_path(File.dirname(__FILE__) + "/../fixture_rails_root/config/environment") - require Rails.root.join('db/schema').to_s - require 'rspec/rails' +ENV["RAILS_ENV"] ||= 'test' +require File.expand_path(File.dirname(__FILE__) + "/../fixture_rails_root/config/environment") +require Rails.root.join('db/schema').to_s +require 'rspec/rails' - $: << File.expand_path(File.dirname(__FILE__) + '/../lib/') - require 'plutus' +$: << File.expand_path(File.dirname(__FILE__) + '/../lib/') +require 'plutus' - Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| require f} +Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| require f} - RSpec.configure do |config| - config.use_transactional_fixtures = true - end +RSpec.configure do |config| + config.use_transactional_fixtures = true +end