- def visible? roles
- if MagicNumber['run_mode'] == 0
- return false unless guest_role_check(roles)
- else
- return false unless reader_role_check(roles)
+ scope :find_private, -> (operators) do
+ with_panel.where(Panel.arel_table[:author_id].eq operators.author.id).references(:panel)
+ end
+
+ scope :find_by_panel, -> (panel_id) do
+ find_index.where(panel_id: panel_id).references(:panel)
+ end
+
+ scope :find_by_author, -> (author_id) do
+ find_index.where(Panel.arel_table[:author_id].eq author_id).references(:panel)
+ end
+
+ def self.by_author_list_includes
+ {
+ :panel => {
+ :author => {}
+ }
+ }
+ end
+
+ def self.has_picture?
+ false
+ end
+
+ def supply_default
+ self.code ||= 0
+ if self.panel
+ self.t = self.panel.new_t
+ self.z = self.panel.new_z