Annotate models
This commit is contained in:
parent
cb05d1d742
commit
dcae5f8784
11 changed files with 117 additions and 0 deletions
2
Gemfile
2
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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue