Sha256: fc7bb9bbe3e508740770da76cd5350161d58b273af628123feb9c6bc49fa6a74
Contents?: true
Size: 1.12 KB
Versions: 53
Compression:
Stored size: 1.12 KB
Contents
class CreateActiveadminSelleoCmsSearches < ActiveRecord::Migration def up ActiveRecord::Base.connection.execute <<-SQL CREATE VIEW activeadmin_selleo_cms_searches AS SELECT 'ActiveadminSelleoCms::Page' AS searchable_type, page_translations.activeadmin_selleo_cms_page_id AS searchable_id, coalesce(page_translations.title,'')||' '||coalesce(page_translations.browser_title,'') AS content, page_translations.locale FROM activeadmin_selleo_cms_page_translations page_translations UNION ALL SELECT 'ActiveadminSelleoCms::Page' AS searchable_type, sections.sectionable_id AS searchable_id, coalesce(section_translations.body,'') AS content, section_translations.locale FROM activeadmin_selleo_cms_section_translations section_translations INNER JOIN activeadmin_selleo_cms_sections sections ON sections.id = section_translations.activeadmin_selleo_cms_section_id SQL end def down ActiveRecord::Base.connection.execute <<-SQL DROP VIEW activeadmin_selleo_cms_searches SQL end end
Version data entries
53 entries across 53 versions & 1 rubygems