Annotate models

This commit is contained in:
Ilion Beyst 2015-09-08 11:44:40 +02:00
parent cb05d1d742
commit dcae5f8784
11 changed files with 117 additions and 0 deletions

View file

@ -52,6 +52,8 @@ group :development do
# Access an IRB console on exception pages or by using <%= console %> in views # Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0' gem 'web-console', '~> 2.0'
gem 'annotate'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring' gem 'spring'
end end

View file

@ -36,6 +36,9 @@ GEM
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
annotate (2.6.10)
activerecord (>= 3.2, <= 4.3)
rake (~> 10.4)
arel (6.0.3) arel (6.0.3)
bcrypt (3.1.10) bcrypt (3.1.10)
binding_of_caller (0.7.2) binding_of_caller (0.7.2)
@ -196,6 +199,7 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
annotate
byebug byebug
cancancan cancancan
coffee-rails (~> 4.1.0) coffee-rails (~> 4.1.0)

View file

@ -1,2 +1,13 @@
# == Schema Information
#
# Table name: clients
#
# id :integer not null, primary key
# name :string not null
# key :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
class Client < ActiveRecord::Base class Client < ActiveRecord::Base
end end

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: transactions
#
# id :integer not null, primary key
# debtor_id :integer not null
# creditor_id :integer not null
# amount :integer default(0), not null
# origin :string not null
# message :string
# created_at :datetime not null
# updated_at :datetime not null
#
class Transaction < ActiveRecord::Base class Transaction < ActiveRecord::Base
belongs_to :debtor belongs_to :debtor
belongs_to :creditor belongs_to :creditor

View file

@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# name :string
# balance :integer default(0), not null
# penning :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
#
class User < ActiveRecord::Base class User < ActiveRecord::Base
devise :timeoutable, :omniauthable, :omniauth_providers => [:zeuswpi] devise :timeoutable, :omniauthable, :omniauth_providers => [:zeuswpi]
end end

View file

@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: clients
#
# id :integer not null, primary key
# name :string not null
# key :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
FactoryGirl.define do FactoryGirl.define do
factory :client do factory :client do
name "MyString" name "MyString"

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: transactions
#
# id :integer not null, primary key
# debtor_id :integer not null
# creditor_id :integer not null
# amount :integer default(0), not null
# origin :string not null
# message :string
# created_at :datetime not null
# updated_at :datetime not null
#
FactoryGirl.define do FactoryGirl.define do
factory :transaction do factory :transaction do
debtor nil debtor nil

View file

@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# name :string
# balance :integer default(0), not null
# penning :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
#
FactoryGirl.define do FactoryGirl.define do
factory :user do factory :user do

View file

@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: clients
#
# id :integer not null, primary key
# name :string not null
# key :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
require 'rails_helper' require 'rails_helper'
RSpec.describe Client, type: :model do RSpec.describe Client, type: :model do

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: transactions
#
# id :integer not null, primary key
# debtor_id :integer not null
# creditor_id :integer not null
# amount :integer default(0), not null
# origin :string not null
# message :string
# created_at :datetime not null
# updated_at :datetime not null
#
require 'rails_helper' require 'rails_helper'
RSpec.describe Transaction, type: :model do RSpec.describe Transaction, type: :model do

View file

@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# name :string
# balance :integer default(0), not null
# penning :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
#
require 'rails_helper' require 'rails_helper'
RSpec.describe User, type: :model do RSpec.describe User, type: :model do