Sha256: 848acf30b0e5d61260e06c3232e955e854f2ab8113c57bceaf3c820cc6e283a8

Contents?: true

Size: 652 Bytes

Versions: 7

Compression:

Stored size: 652 Bytes

Contents

module Refinery
  
  def self.add_gems
    ActiveRecord::Base.module_eval do
  		begin
  			require 'friendly_id'
  			require 'will_paginate'
  			require 'aasm'
  		rescue LoadError => load_error
  			# this will stop us running rake gems:install which we don't really want so just trap this error.
  		end
  	end
  	
  	# Stub has_friendly_id unless it is already included.
  	# The config will still complain that the gem is missing but this allows it to do so.
    ActiveRecord::Base.class_eval do
  	  def self.has_friendly_id(column, options = {}, &block)
	    end
	  end unless ActiveRecord::Base.methods.include? 'has_friendly_id'
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
refinerycms-0.9.4.3 vendor/plugins/refinery/lib/refinery.rb
refinerycms-0.9.4.2 vendor/plugins/refinery/lib/refinery.rb
refinerycms-0.9.4.1 vendor/plugins/refinery/lib/refinery.rb
refinerycms-0.9.4 vendor/plugins/refinery/lib/refinery.rb
refinerycms-0.9.3 vendor/plugins/refinery/lib/refinery.rb
refinerycms-0.9.2.2 vendor/plugins/refinery/lib/refinery.rb
refinerycms-0.9.2.1 vendor/plugins/refinery/lib/refinery.rb