diff --git a/app/models/campaign.rb b/app/models/campaign.rb index 0f568f72..efc145bd 100644 --- a/app/models/campaign.rb +++ b/app/models/campaign.rb @@ -66,7 +66,6 @@ class Campaign < ActiveRecord::Base has_many :activities, as: :host, dependent: :destroy belongs_to :profile belongs_to :nonprofit - belongs_to :campaign_template belongs_to :parent_campaign, class_name: 'Campaign' has_many :children_campaigns, class_name: 'Campaign', foreign_key: 'parent_campaign_id' diff --git a/app/models/campaign_template.rb b/app/models/campaign_template.rb deleted file mode 100644 index 1ae38662..00000000 --- a/app/models/campaign_template.rb +++ /dev/null @@ -1,51 +0,0 @@ -# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -class CampaignTemplate < ActiveRecord::Base - CUSTOMIZABLE_ATTR = %i(goal_amount) - - attr_accessible \ - :template_name, - :name, # refers to campaign name - :tagline, - :goal_amount, - :goal_amount_dollars, # accessor: translated into goal_amount (cents) - :main_image, - :remove_main_image, # for carrierwave - :video_url, - :vimeo_video_id, - :youtube_video_id, - :summary, - :body, - :end_datetime, - :goal_customizable, - :nonprofit_id - - attr_accessor :end_datetime - attr_accessor :goal_amount_dollars - - has_many :campaigns - belongs_to :nonprofit - - mount_uploader :main_image, CampaignTemplateMainImageUploader - - before_validation do - if self.goal_amount_dollars.present? - self.goal_amount = (self.goal_amount_dollars.gsub(',','').to_f * 100).to_i - end - self - end - - def customizable_attribute?(attribute_name) - CUSTOMIZABLE_ATTR.include? attribute_name.to_sym - end - - def customizable_attributes_list - CUSTOMIZABLE_ATTR - end - - def create_campaign_params - excluded = %w( - id template_name created_at updated_at - ) - attributes.except!(*excluded) - end -end diff --git a/app/models/nonprofit.rb b/app/models/nonprofit.rb index 2d512444..421b59b1 100755 --- a/app/models/nonprofit.rb +++ b/app/models/nonprofit.rb @@ -62,7 +62,6 @@ class Nonprofit < ActiveRecord::Base has_many :supporter_notes, through: :supporters has_many :profiles, through: :donations has_many :campaigns, dependent: :destroy - has_many :campaign_templates, dependent: :destroy has_many :events, dependent: :destroy has_many :tickets, through: :events has_many :users, through: :roles