module Hobo

Constants

VERSION

Attributes

engines[RW]
stable_cache[RW]

Public Class Methods

raw_js(s) click to toggle source
# File lib/hobo.rb, line 34
def raw_js(s)
  RawJs.new(s)
end
root() click to toggle source
# File lib/hobo.rb, line 19
def self.root; @@root; end
simple_has_many_association?(array_or_reflection) click to toggle source
# File lib/hobo.rb, line 61
def simple_has_many_association?(array_or_reflection)
  refl = array_or_reflection.respond_to?(:proxy_association) ? array_or_reflection.proxy_association.reflection : array_or_reflection
  return false unless refl.is_a?(ActiveRecord::Reflection::AssociationReflection)
  refl.macro == :has_many and
    (not refl.through_reflection) and
    (not refl.options[:conditions])
end
subsites() click to toggle source
# File lib/hobo.rb, line 69
def subsites
  # Any directory inside app/controllers defines a subsite
  app_dirs = ["#{Rails.root}/app"] + Hobo.engines.map { |e| "#{e}/app" }
  @subsites ||= app_dirs.map do |app|
                  Dir["#{app}/controllers/*"].map do |f|
                    File.basename(f) if File.directory?(f)
                  end.compact
                end.flatten
end