You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: page.rb
    path of file: ./repos/refinerycms/pages/app/models/refinery
    
    the code of the file until where you have to start completion: # Encoding: utf-8
require 'friendly_id'
require 'friendly_id/mobility'
require 'refinery/core/base_model'
require 'refinery/pages/url'
require 'refinery/pages/finder'

module Refinery
  class Page < Core::BaseModel
    extend Mobility
    translates :title, :menu_title, :custom_slug, :slug, :browser_title, :meta_description

    after_save { translations.in_locale(Mobility.locale).seo_meta.save! }

  
    
      def nullify_duplicate_slugs_under_the_same_parent!
        t_slug = Translation.arel_table[:slug]
        joins(:translations).group(:locale, :parent_id, t_slug).having(t_slug.count.gt(1)).count.
        each do |(locale, parent_id, slug), count|
          by_slug(slug, :locale => locale).where(:parent_id => parent_id).drop(1).each do |page|
            page.slug = nil # kill the duplicate slug
            page.save # regenerate the slug
          end
        end
      end