Sha256: d5f5fc02daca4f6817776ea2089b57d8ccfbbad04f58c0fbb82acec343a2e844
Contents?: true
Size: 1.36 KB
Versions: 31
Compression:
Stored size: 1.36 KB
Contents
require "active_record" require "action_view" require "active_support/hash_with_indifferent_access" module Tagtical # Place a tagtical.yml file in the config directory to control settings mattr_accessor :config self.config = ActiveSupport::InheritableOptions.new(ActiveSupport::HashWithIndifferentAccess.new.tap do |hash| require 'yaml' path = Rails.root.join("config", "tagtical.yml") rescue "" hash.update(YAML.load_file(path)) if File.exists?(path) # If tagger association options were not provided, then use the polymorphic_tagger association. hash.reverse_merge!( :polymorphic_tagger? => !hash[:tagger] ) end) end $LOAD_PATH.unshift(File.dirname(__FILE__)) require "tagtical/compatibility/active_record_backports" if ActiveRecord::VERSION::MAJOR < 3 require "tagtical/taggable" require "tagtical/taggable/core" require "tagtical/taggable/collection" require "tagtical/taggable/cache" require "tagtical/taggable/ownership" require "tagtical/taggable/related" require "tagtical/acts_as_tagger" require "tagtical/tag" require "tagtical/tag_list" require "tagtical/tags_helper" require "tagtical/tagging" $LOAD_PATH.shift if defined?(ActiveRecord::Base) ActiveRecord::Base.extend Tagtical::Taggable ActiveRecord::Base.send :include, Tagtical::Tagger end if defined?(ActionView::Base) ActionView::Base.send :include, Tagtical::TagsHelper end
Version data entries
31 entries across 31 versions & 1 rubygems