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: resource.rb
    path of file: ./repos/refinerycms/resources/app/models/refinery
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'dragonfly'

module Refinery
  class Resource < Refinery::Core::BaseModel
    include Resources::Validators

    extend Mobility
    translates :resource_title

    dragonfly_accessor :file, app: :refinery
    
      def create_resources(params)
        resources = []

        if params.present? && params[:file].is_a?(Array)
          params[:file].each do |resource|
            resources << create({ file: resource }.merge(params.except(:file).to_h))
          end
        else
          resources << create(params)
        end