cirandas.net

ref: master

plugins/volunteers/lib/ext/profile.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require_dependency 'profile'

# attr_accessible must be defined on subclasses
Profile.descendants.each do |subclass|
  subclass.class_eval do
    attr_accessible :volunteers_settings
  end
end

class Profile

  def volunteers_settings attrs = {}
    @volunteers_settings ||= Noosfero::Plugin::Settings.new self, VolunteersPlugin, attrs
    attrs.each{ |a, v| @volunteers_settings.send "#{a}=", v }
    @volunteers_settings
  end
  alias_method :volunteers_settings=, :volunteers_settings

end