Module: DataMiner::ActiveRecordExt::ClassMethods
- Defined in:
- lib/data_miner/active_record_ext.rb
Instance Method Summary collapse
Instance Method Details
#mine_data(options = {}, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/data_miner/active_record_ext.rb', line 8 def mine_data( = {}, &block) if defined?(NO_DATA_MINER) and NO_DATA_MINER == true class_eval do class << self def data_mine raise "NO_DATA_MINER is set to true, so data_mine is not available" end end end else class_eval { cattr_accessor :data_mine } self.data_mine = Configuration.new(self) yield data_mine end end |