lib/activity_notification/config.rb in activity_notification-1.2.1 vs lib/activity_notification/config.rb in activity_notification-1.3.0
- old
+ new
@@ -108,10 +108,15 @@
# Sets default limit to query for opened notifications
# @param [Integer] opened_index_limit The new opened_index_limit
# @return [Integer] Default limit to query for opened notifications.
attr_accessor :opened_index_limit
+ # @overload :orm
+ # Returns ORM name for ActivityNotification (:active_record or :mongoid)
+ # @return [Boolean] ORM name for ActivityNotification (:active_record or :mongoid).
+ attr_reader :orm
+
# Initialize configuration for ActivityNotification.
# These configuration can be overriden in initializer.
# @return [Config] A new instance of Config
def initialize
@enabled = true
@@ -123,9 +128,16 @@
@mailer_sender = nil
@mailer = 'ActivityNotification::Mailer'
@parent_mailer = 'ActionMailer::Base'
@parent_controller = 'ApplicationController'
@opened_index_limit = 10
+ @orm = :active_record
end
+ # Sets ORM name for ActivityNotification (:active_record or :mongoid)
+ # @param [Symbol, String] orm The new ORM name for ActivityNotification (:active_record or :mongoid)
+ # @return [Symbol] ORM name for ActivityNotification (:active_record or :mongoid).
+ def orm=(orm)
+ @orm = orm.to_sym
+ end
end
end