Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Annotated models
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrei committed Sep 7, 2016
1 parent 902ab4b commit 800d11a
Show file tree
Hide file tree
Showing 98 changed files with 1,502 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -102,6 +102,7 @@ gem 'metamagic'
group :development do
gem 'web-console', '~> 2.0'
gem 'rubocop', require: false
gem 'annotate'
end

group :development, :test do
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -78,6 +78,9 @@ GEM
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
annotate (2.7.1)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 12.0)
arbre (1.0.3)
activesupport (>= 3.0.0)
arel (6.0.3)
Expand Down Expand Up @@ -514,6 +517,7 @@ DEPENDENCIES
aasm
action_parameter
activeadmin!
annotate
aws-sdk (~> 2)
aws-sdk-v1
bootstrap-sass (~> 3.3.5)
Expand Down
17 changes: 17 additions & 0 deletions app/models/action.rb
@@ -1,4 +1,21 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: actions
#
# id :integer not null, primary key
# page_id :integer
# member_id :integer
# link :string
# created_user :boolean
# subscribed_user :boolean
# created_at :datetime not null
# updated_at :datetime not null
# form_data :jsonb
# subscribed_member :boolean default(TRUE)
# donation :boolean default(FALSE)
#

class Action < ActiveRecord::Base
belongs_to :page, counter_cache: :action_count
belongs_to :member
Expand Down
9 changes: 9 additions & 0 deletions app/models/actionkit_page.rb
@@ -1,4 +1,13 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: actionkit_pages
#
# id :integer not null, primary key
# actionkit_id :integer not null
# actionkit_page_type_id :integer not null
#

class ActionkitPage < ActiveRecord::Base
belongs_to :page
has_paper_trail
Expand Down
8 changes: 8 additions & 0 deletions app/models/actionkit_page_type.rb
@@ -1,4 +1,12 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: actionkit_page_types
#
# id :integer not null, primary key
# actionkit_page_type :string not null
#

class ActionkitPageType < ActiveRecord::Base
has_many :actionkit_page

Expand Down
13 changes: 13 additions & 0 deletions app/models/ak_log.rb
@@ -1,3 +1,16 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: ak_logs
#
# id :integer not null, primary key
# request_body :text
# response_body :text
# response_status :string
# resource :string
# created_at :datetime not null
# updated_at :datetime not null
#

class AkLog < ActiveRecord::Base
end
10 changes: 10 additions & 0 deletions app/models/campaign.rb
@@ -1,4 +1,14 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: campaigns
#
# id :integer not null, primary key
# name :string
# created_at :datetime
# updated_at :datetime
#

class Campaign < ActiveRecord::Base
has_paper_trail
has_many :pages
Expand Down
11 changes: 11 additions & 0 deletions app/models/donation_band.rb
@@ -1,4 +1,15 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: donation_bands
#
# id :integer not null, primary key
# name :string
# amounts :integer default([]), is an Array
# created_at :datetime not null
# updated_at :datetime not null
#

class DonationBand < ActiveRecord::Base
has_paper_trail

Expand Down
15 changes: 15 additions & 0 deletions app/models/form.rb
@@ -1,4 +1,19 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: forms
#
# id :integer not null, primary key
# name :string
# description :string
# created_at :datetime not null
# updated_at :datetime not null
# visible :boolean default(FALSE)
# master :boolean default(FALSE)
# formable_id :integer
# formable_type :string
#

class Form < ActiveRecord::Base
# DEFAULT_ constants are used for building an initial, default
# form. See service class +DefaultFormBuilder+.
Expand Down
17 changes: 17 additions & 0 deletions app/models/form_element.rb
@@ -1,4 +1,21 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: form_elements
#
# id :integer not null, primary key
# form_id :integer
# label :string
# data_type :string
# default_value :string
# required :boolean
# visible :boolean
# created_at :datetime not null
# updated_at :datetime not null
# name :string
# position :integer default(0), not null
#

class FormElement < ActiveRecord::Base
belongs_to :form, touch: true
has_paper_trail
Expand Down
14 changes: 14 additions & 0 deletions app/models/image.rb
@@ -1,4 +1,18 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: images
#
# id :integer not null, primary key
# content_file_name :string
# content_content_type :string
# content_file_size :integer
# content_updated_at :datetime
# created_at :datetime
# updated_at :datetime
# page_id :integer
#

class Image < ActiveRecord::Base
has_paper_trail

Expand Down
12 changes: 12 additions & 0 deletions app/models/language.rb
@@ -1,4 +1,16 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: languages
#
# id :integer not null, primary key
# code :string not null
# name :string not null
# created_at :datetime
# updated_at :datetime
# actionkit_uri :string
#

class Language < ActiveRecord::Base
has_paper_trail on: [:update, :destroy]
has_many :pages
Expand Down
14 changes: 14 additions & 0 deletions app/models/link.rb
@@ -1,4 +1,18 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: links
#
# id :integer not null, primary key
# url :string
# title :string
# date :string
# source :string
# page_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#

class Link < ActiveRecord::Base
belongs_to :page, touch: true
has_paper_trail on: [:update, :destroy]
Expand Down
16 changes: 16 additions & 0 deletions app/models/liquid_layout.rb
@@ -1,4 +1,20 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: liquid_layouts
#
# id :integer not null, primary key
# title :string
# content :text
# created_at :datetime not null
# updated_at :datetime not null
# description :text
# experimental :boolean default(FALSE), not null
# default_follow_up_layout_id :integer
# primary_layout :boolean
# post_action_layout :boolean
#

class LiquidLayout < ActiveRecord::Base
include HasLiquidPartials
has_paper_trail
Expand Down
11 changes: 11 additions & 0 deletions app/models/liquid_partial.rb
@@ -1,4 +1,15 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: liquid_partials
#
# id :integer not null, primary key
# title :string
# content :text
# created_at :datetime not null
# updated_at :datetime not null
#

class LiquidPartial < ActiveRecord::Base
include HasLiquidPartials
has_paper_trail
Expand Down
20 changes: 20 additions & 0 deletions app/models/member.rb
@@ -1,4 +1,24 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: members
#
# id :integer not null, primary key
# email :string
# country :string
# first_name :string
# last_name :string
# city :string
# postal :string
# title :string
# address1 :string
# address2 :string
# created_at :datetime not null
# updated_at :datetime not null
# actionkit_user_id :string
# donor_status :integer default(0), not null
#

class Member < ActiveRecord::Base
has_one :customer, class_name: 'Payment::Braintree::Customer'
has_many :go_cardless_customers, class_name: 'Payment::GoCardless::Customer'
Expand Down
31 changes: 31 additions & 0 deletions app/models/page.rb
@@ -1,4 +1,35 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: pages
#
# id :integer not null, primary key
# language_id :integer
# campaign_id :integer
# title :string not null
# slug :string not null
# created_at :datetime
# updated_at :datetime
# compiled_html :text
# status :string default("pending")
# messages :text
# content :text default("")
# featured :boolean default(FALSE)
# liquid_layout_id :integer
# follow_up_liquid_layout_id :integer
# action_count :integer default(0)
# primary_image_id :integer
# ak_petition_resource_uri :string
# ak_donation_resource_uri :string
# follow_up_plan :integer default(0), not null
# follow_up_page_id :integer
# javascript :text
# publish_status :integer default(1), not null
# optimizely_status :integer default(0), not null
# canonical_url :string
# allow_duplicate_actions :boolean default(FALSE)
#

class Page < ActiveRecord::Base
extend FriendlyId
has_paper_trail
Expand Down
9 changes: 9 additions & 0 deletions app/models/pages_tag.rb
@@ -1,4 +1,13 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: pages_tags
#
# id :integer not null, primary key
# page_id :integer
# tag_id :integer
#

class PagesTag < ActiveRecord::Base
belongs_to :tag
belongs_to :page
Expand Down
21 changes: 21 additions & 0 deletions app/models/payment/braintree/customer.rb
@@ -1,4 +1,25 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: payment_braintree_customers
#
# id :integer not null, primary key
# card_type :string
# card_bin :string
# cardholder_name :string
# card_debit :string
# card_last_4 :string
# card_vault_token :string
# card_unique_number_identifier :string
# email :string
# first_name :string
# last_name :string
# customer_id :string
# created_at :datetime not null
# updated_at :datetime not null
# member_id :integer
#

class Payment::Braintree::Customer < ActiveRecord::Base
belongs_to :member
has_many :payment_methods, class_name: 'Payment::Braintree::PaymentMethod', foreign_key: 'customer_id'
Expand Down
11 changes: 11 additions & 0 deletions app/models/payment/braintree/notification.rb
@@ -1,2 +1,13 @@
# == Schema Information
#
# Table name: payment_braintree_notifications
#
# id :integer not null, primary key
# payload :text
# signature :text
# created_at :datetime not null
# updated_at :datetime not null
#

class Payment::Braintree::Notification < ActiveRecord::Base
end
11 changes: 11 additions & 0 deletions app/models/payment/braintree/payment_method.rb
@@ -1,4 +1,15 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: payment_braintree_payment_methods
#
# id :integer not null, primary key
# token :string
# created_at :datetime not null
# updated_at :datetime not null
# customer_id :integer
#

class Payment::Braintree::PaymentMethod < ActiveRecord::Base
belongs_to :customer, class_name: 'Payment::Braintree::Customer'
has_many :transactions, class_name: 'Payment::Braintree::Transaction', foreign_key: 'payment_method_id'
Expand Down

0 comments on commit 800d11a

Please sign in to comment.