metamaps--metamaps/app/models/user_preference.rb

19 lines
474 B
Ruby
Raw Normal View History

2016-02-03 13:38:41 +00:00
class UserPreference
attr_accessor :metacodes
2016-02-03 13:38:41 +00:00
def initialize
array = []
%w(Action Aim Idea Question Note Wildcard Subject).each do |m|
begin
metacode = Metacode.find_by_name(m)
array.push(metacode.id.to_s) if metacode
rescue ActiveRecord::StatementInvalid
if m == 'Action'
Rails.logger.warn("TODO: remove this travis workaround in user_preference.rb")
end
end
2016-02-03 13:38:41 +00:00
end
@metacodes = array
end
end