aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inboxes.rb
blob: 49bec390e2fbf000f84570183bf05651e6eb476c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require "inboxes/version"
require "inboxes/railtie"
require "inboxes/engine"
require "inboxes/active_record_extension"

module Inboxes
  
  def self.configure(&block)
    yield @config ||= Inboxes::Configuration.new
  end

  # Global settings for Inboxes
  def self.config
    @config
  end

  # need a Class for 3.0
  class Configuration #:nodoc:
    include ActiveSupport::Configurable
    config_accessor :user_name

    def param_name
      config.param_name.respond_to?(:call) ? config.param_name.call() : config.param_name 
    end
  end
  
  # adding method inboxes for models
  ActiveRecord::Base.extend(Inboxes::ActiveRecordExtension)
  
end