From dcae5f8784f0851f6589a71d13f828ceace82b02 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 8 Sep 2015 11:44:40 +0200 Subject: [PATCH] Annotate models --- Gemfile | 2 ++ Gemfile.lock | 4 ++++ app/models/client.rb | 11 +++++++++++ app/models/transaction.rb | 14 ++++++++++++++ app/models/user.rb | 12 ++++++++++++ spec/factories/clients.rb | 11 +++++++++++ spec/factories/transactions.rb | 14 ++++++++++++++ spec/factories/users.rb | 12 ++++++++++++ spec/models/client_spec.rb | 11 +++++++++++ spec/models/transaction_spec.rb | 14 ++++++++++++++ spec/models/user_spec.rb | 12 ++++++++++++ 11 files changed, 117 insertions(+) diff --git a/Gemfile b/Gemfile index 143525f..3ad8c80 100644 --- a/Gemfile +++ b/Gemfile @@ -52,6 +52,8 @@ group :development do # Access an IRB console on exception pages or by using <%= console %> in views 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 gem 'spring' end diff --git a/Gemfile.lock b/Gemfile.lock index 0dcd4f7..cafca1a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,6 +36,9 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + annotate (2.6.10) + activerecord (>= 3.2, <= 4.3) + rake (~> 10.4) arel (6.0.3) bcrypt (3.1.10) binding_of_caller (0.7.2) @@ -196,6 +199,7 @@ PLATFORMS ruby DEPENDENCIES + annotate byebug cancancan coffee-rails (~> 4.1.0) diff --git a/app/models/client.rb b/app/models/client.rb index 998b2e4..84199ac 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -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 end diff --git a/app/models/transaction.rb b/app/models/transaction.rb index 80ca2f0..d3c868d 100644 --- a/app/models/transaction.rb +++ b/app/models/transaction.rb @@ -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 belongs_to :debtor belongs_to :creditor diff --git a/app/models/user.rb b/app/models/user.rb index b4f95a2..1a49da2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 devise :timeoutable, :omniauthable, :omniauth_providers => [:zeuswpi] end diff --git a/spec/factories/clients.rb b/spec/factories/clients.rb index acf9478..598d1c1 100644 --- a/spec/factories/clients.rb +++ b/spec/factories/clients.rb @@ -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 factory :client do name "MyString" diff --git a/spec/factories/transactions.rb b/spec/factories/transactions.rb index 9561b45..5273d51 100644 --- a/spec/factories/transactions.rb +++ b/spec/factories/transactions.rb @@ -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 factory :transaction do debtor nil diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 209e6b1..c1ad519 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -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 factory :user do diff --git a/spec/models/client_spec.rb b/spec/models/client_spec.rb index 2e2c38a..640750d 100644 --- a/spec/models/client_spec.rb +++ b/spec/models/client_spec.rb @@ -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' RSpec.describe Client, type: :model do diff --git a/spec/models/transaction_spec.rb b/spec/models/transaction_spec.rb index 572759a..07cf2b7 100644 --- a/spec/models/transaction_spec.rb +++ b/spec/models/transaction_spec.rb @@ -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' RSpec.describe Transaction, type: :model do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 47a31bb..4a84ec7 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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' RSpec.describe User, type: :model do