def create_revision
      return unless revision_data

      limit = ComfortableMexicanSofa.config.revisions_limit.to_i

      # creating revision
      if limit != 0
        revisions.create!(data: revision_data)
      end

      # blowing away old revisions
      ids = [0] + revisions.order(created_at: :desc).limit(limit).pluck(:id)
      revisions.where("id NOT IN (?)", ids).destroy_all
    end
def create_revision
      return unless revision_data

      limit = ComfortableMexicanSofa.config.revisions_limit.to_i

      # creating revision
      if limit != 0
        revisions.create!(data: revision_data)
      end

      # blowing away old revisions
      ids = [0] + revisions.order(created_at: :desc).limit(limit).pluck(:id)
      revisions.where("id NOT IN (?)", ids).destroy_all
    end
Revision is created only if relevant data changed