В моей заявке на рельсы есть модель компании. Который состоит из следующих полей:
class Company < ApplicationRecord
include Validatable
validates :contact_one, :city, :state, :country, :address, presence: true
validates :email, presence: true, uniqueness: true
has_many :company_domains
has_many :domains, through: :company_domains
has_many :job_posts
has_many :contacts
has_many :images, as: :imageable
belongs_to :industry, optional: true, counter_cache: true
belongs_to :user, optional: true
def pending_approval?
self.status == 'in-review'
end
def approved?
self.status == 'approved'
end
end
# == Schema Information
#
# Table name: companies
#
# id :integer not null, primary key
# address :string
# city :string
# company_domains_count :integer
# company_size :string
# contact_one :string
# contact_two :string
# contacts_count :integer
# country :string
# cover_image :string
# email :string
# facebook_url :string
# fax :string
# google_plus_url :string
# job_posts_count :integer
# latitude :float
# linkedin_url :string
# logo_image :string
# longitude :float
# name :string
# state :string
# status :string
# twitter_url :string
# website :string
# year_of_establishment :date
# youtube_url :string
# created_at :datetime not null
# updated_at :datetime not null
# industry_id :integer
# user_id :integer
Когда я проверяю Company.instance_methods (false) в консоли rails Тогда я получил следующий массив методов экземпляра:
[:after_add_for_images?, :after_add_for_images=, :before_remove_for_images, :before_remove_for_images?, :before_remove_for_images=, :after_remove_for_images, :after_remove_for_images?, :after_remove_for_images=, :belongs_to_counter_cache_after_update, :autosave_associated_records_for_industry, :autosave_associated_records_for_user, :autosave_associated_records_for_company_domains, :validate_associated_records_for_company_domains, :before_add_for_company_domains, :before_add_for_company_domains?, :before_add_for_company_domains=, :after_add_for_company_domains, :after_add_for_company_domains?, :after_add_for_company_domains=, :before_remove_for_company_domains, :before_remove_for_company_domains?, :before_remove_for_company_domains=, :after_remove_for_company_domains, :after_remove_for_company_domains?, :after_remove_for_company_domains=, :autosave_associated_records_for_domains, :validate_associated_records_for_domains, :before_add_for_domains, :before_add_for_domains?, :before_add_for_domains=, :after_add_for_domains, :after_add_for_domains?, :after_add_for_domains=, :before_remove_for_domains, :before_remove_for_domains?, :before_remove_for_domains=, :after_remove_for_domains, :after_remove_for_domains?, :after_remove_for_domains=, :autosave_associated_records_for_job_posts, :validate_associated_records_for_job_posts, :before_add_for_job_posts, :before_add_for_job_posts?, :before_add_for_job_posts=, :after_add_for_job_posts, :after_add_for_job_posts?, :after_add_for_job_posts=, :before_remove_for_job_posts, :before_remove_for_job_posts?, :before_remove_for_job_posts=, :after_remove_for_job_posts, :after_remove_for_job_posts?, :after_remove_for_job_posts=, :autosave_associated_records_for_contacts, :validate_associated_records_for_contacts, :before_add_for_contacts, :before_add_for_contacts?, :before_add_for_contacts=, :after_add_for_contacts, :after_add_for_contacts?, :after_add_for_contacts=, :before_remove_for_contacts, :before_remove_for_contacts?, :before_remove_for_contacts=, :after_remove_for_contacts, :after_remove_for_contacts?, :after_remove_for_contacts=, :autosave_associated_records_for_images, :validate_associated_records_for_images, :before_add_for_images, :before_add_for_images?, :before_add_for_images=, :after_add_for_images]
Может кто-нибудь помочь мне понять, что эти методы будут делать?