Module: ParanoidDummy::ClassMethods
- Defined in:
- lib/paranoid_dummy/paranoid_dummy.rb
Instance Method Summary collapse
Instance Method Details
#define_paranoid_dummy(options = {}, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/paranoid_dummy/paranoid_dummy.rb', line 8 def define_paranoid_dummy = {}, &block if not .is_a?(Hash) and not .empty? raise ArgumentError, "Hash expected, got #{.class.name}" end if block_given? dummy.instance_eval &block if [:for].present? and [:for].is_a?(Array) [:for] else create_paranoid_methods_from_associations end end end |