Sha256: e20f924d8b06edff51a72c0ac0abc80b99ea5c3047339fdd0f8fa46be6996067

Contents?: true

Size: 417 Bytes

Versions: 4

Compression:

Stored size: 417 Bytes

Contents

# Additions to ActiveRecord::Base.
module Pose
  module ActiveRecordBaseAdditions

    # Defines the searchable content in ActiveRecord objects.
    def posify &block
      raise "Error while posifying class '#{name}': " \
            "You must provide a block that returns the searchable content to 'posify'." unless block_given?

      include ModelClassAdditions
      self.pose_content = block
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pose-3.0.0 lib/pose/activerecord_base_additions.rb
pose-2.1.0 lib/pose/activerecord_base_additions.rb
pose-2.0.1 lib/pose/activerecord_base_additions.rb
pose-2.0.0 lib/pose/activerecord_base_additions.rb