Module: Survey::ActiveRecord::ClassMethods
- Defined in:
- lib/survey/active_record.rb
Instance Method Summary collapse
Instance Method Details
#acceptable_attributes(*args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/survey/active_record.rb', line 15 def acceptable_attributes(*args) self.const_set('AccessibleAttributes', args + [:id, :_destroy]) in_rails_3 do if defined?(self.respond_to?(:attr_accessible)) attr_accessible(*self.const_get('AccessibleAttributes').map { |k| k.is_a?(Hash) ? k.keys.first : k }) end end end |