Commit bb12b081 by ivan Lan

Add :shotengai_series to product

parent 63ec9993
...@@ -33,6 +33,7 @@ module Shotengai ...@@ -33,6 +33,7 @@ module Shotengai
harray_accessor :spec_template, :remark_template harray_accessor :spec_template, :remark_template
template_with_value_getters :spec, :remark, value_in_template: true template_with_value_getters :spec, :remark, value_in_template: true
has_many :shotengai_series, class_name: 'Shotengai::Series', foreign_key: :shotengai_product_id
belongs_to :manager, polymorphic: true, optional: true#, touch: true belongs_to :manager, polymorphic: true, optional: true#, touch: true
default_scope { order(created_at: :desc) } default_scope { order(created_at: :desc) }
...@@ -78,7 +79,7 @@ module Shotengai ...@@ -78,7 +79,7 @@ module Shotengai
} }
def default_series def default_series
Shotengai::Series.alive.find_by_id(default_series_id) || series.alive.first Shotengai::Series.alive.find_by_id(default_series_id) || shotengai_series.alive.first
end end
def meta def meta
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment