Class: Spree::CustomEmail

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/spree/custom_email.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ransackable_associations(_auth_object = nil) ⇒ Object



21
22
23
# File 'app/models/spree/custom_email.rb', line 21

def self.ransackable_associations(_auth_object = nil)
  %w[store]
end

.ransackable_attributes(_auth_object = nil) ⇒ Object

Spree 5.2(Ransack 4.x)は検索・ソート対象を明示的に allowlist することを要求する。 ActiveRecord::Base 継承で Spree::Core::Ransackable を含まないため、Ransack 標準の ransackable_attributes / ransackable_associations をオーバーライドして許可する。



17
18
19
# File 'app/models/spree/custom_email.rb', line 17

def self.ransackable_attributes(_auth_object = nil)
  %w[id store_id mail_type subject header footer created_at updated_at]
end

Instance Method Details



29
30
31
# File 'app/models/spree/custom_email.rb', line 29

def footer_for(format)
  format_content(footer, format)
end

#header_for(format) ⇒ Object



25
26
27
# File 'app/models/spree/custom_email.rb', line 25

def header_for(format)
  format_content(header, format)
end