Ignore unused organizations columns (#6933) [deploy]

This commit is contained in:
rhymes 2020-03-30 19:00:31 +02:00 committed by GitHub
parent c0a9ff75b6
commit 66515d1258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 18 deletions

View file

@ -19,19 +19,11 @@ class OrganizationDashboard < Administrate::BaseDashboard
url: Field::String,
twitter_username: Field::String,
github_username: Field::String,
jobs_url: Field::String,
jobs_email: Field::String,
address: Field::String,
city: Field::String,
state: Field::String,
zip_code: Field::String,
bg_color_hex: Field::String,
text_color_hex: Field::String,
country: Field::String,
created_at: Field::DateTime,
updated_at: Field::DateTime,
users: Field::HasMany,
approved: Field::Boolean,
cta_button_text: Field::String,
cta_button_url: Field::String,
cta_body_markdown: Field::Text
@ -47,7 +39,6 @@ class OrganizationDashboard < Administrate::BaseDashboard
name
url
twitter_username
approved
].freeze
# SHOW_PAGE_ATTRIBUTES
@ -70,14 +61,7 @@ class OrganizationDashboard < Administrate::BaseDashboard
text_color_hex
twitter_username
github_username
jobs_url
jobs_email
address
city
state
zip_code
country
approved
cta_button_text
cta_button_url
cta_body_markdown

View file

@ -1,4 +1,15 @@
class Organization < ApplicationRecord
self.ignored_columns = %w[
address
approved
city
country
jobs_email
jobs_url
state
zip_code
]
include CloudinaryHelper
acts_as_followable
@ -24,7 +35,6 @@ class Organization < ApplicationRecord
length: { maximum: 250 }
validates :tag_line,
length: { maximum: 60 }
validates :jobs_email, email: true, allow_blank: true
validates :text_color_hex, format: /\A#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/, allow_blank: true
validates :bg_color_hex, format: /\A#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/, allow_blank: true
validates :slug,

View file

@ -2,7 +2,7 @@ require "rails_helper"
RSpec.describe "UserOrganization", type: :request do
let(:user) { create(:user) }
let(:organization) { create(:organization, secret: "SECRET", approved: true) }
let(:organization) { create(:organization, secret: "SECRET") }
context "when joining an org" do
before { sign_in user }