{"id":267967,"date":"2015-11-11T14:01:04","date_gmt":"2015-11-11T11:01:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=267967"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=267967","title":{"rendered":"\u041a\u0430\u043a \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 Redmine"},"content":{"rendered":"<p>       \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c <a href=\"https:\/\/github.com\/centosadmin\/redmine_intouch\">redmine_intouch<\/a> \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <a href=\"http:\/\/centos-admin.ru\/\">Centos-admin.ru<\/a>.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u0431\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u0445\u043e\u0447\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0434\u043b\u044f Redmine.<\/p>\n<p>  \u0422.\u043a. \u044d\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0433\u0435\u043c\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u2014 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0441\u0430\u043c\u043e\u0433\u043e Redmine.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u0447\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043d\u0443\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0435\u0439.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/company\/centosadmin\/blog\/270615\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/79c\/569\/743\/79c5697436cc482b90fa2df53f3b4bcb.png\" alt=\"image\"\/><\/a><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430, \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0442\u0440\u0451\u0445 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u0432, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043a\u043b\u0430\u0434\u043e\u043a, \u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u043c\u0430\u0441\u0441\u0430 \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u043e\u0432. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041a\u0430\u043a \u0436\u0435 \u044d\u0442\u043e \u0432\u0441\u0451 \u0445\u0440\u0430\u043d\u0438\u0442\u044c?<\/h4>\n<p>  \u0421\u043f\u0435\u0440\u0432\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u0445.<\/p>\n<p>  \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 <a href=\"https:\/\/github.com\/RCRM\/redmine_contacts\">redmine_contacts<\/a>. \u0412 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c <a href=\"https:\/\/github.com\/RCRM\/redmine_contacts\/blob\/master\/app\/models\/contacts_setting.rb\">ContactsSetting<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443.<\/p>\n<p>  \u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">intouch_setting.rb<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"ruby\">class IntouchSetting &lt; ActiveRecord::Base   unloadable   belongs_to :project    attr_accessible :name, :value, :project_id    cattr_accessor :available_settings   self.available_settings ||= {}    def self.load_available_settings     %w(alarm new working feedback overdue).each do |notice|       %w(author assigned_to watchers).each do |receiver|         define_setting &quot;telegram_#{notice}_#{receiver}&quot;       end       define_setting &quot;telegram_#{notice}_telegram_groups&quot;, serialized: true, default: {}       define_setting &quot;telegram_#{notice}_user_groups&quot;, serialized: true, default: {}     end     define_setting 'email_cc', default: ''   end     def self.define_setting(name, options={})     available_settings[name.to_s] = options   end   # Hash used to cache setting values   @intouch_cached_settings = {}   @intouch_cached_cleared_on = Time.now    # Hash used to cache setting values   @cached_settings = {}   @cached_cleared_on = Time.now     validates_uniqueness_of :name, scope: [:project_id]    def value     v = read_attribute(:value)     # Unserialize serialized settings     if available_settings[name][:serialized] && v.is_a?(String)       v = YAML::load(v)       v = force_utf8_strings(v)     end     # v = v.to_sym if available_settings[name]['format'] == 'symbol' && !v.blank?     v   end    def value=(v)     v = v.to_yaml if v && available_settings[name] && available_settings[name][:serialized]     write_attribute(:value, v.to_s)   end    # Returns the value of the setting named name   def self.[](name, project_id)     project_id = project_id.id if project_id.is_a?(Project)     v = @intouch_cached_settings[hk(name, project_id)]     v ? v : (@intouch_cached_settings[hk(name, project_id)] = find_or_default(name, project_id).value)   end    def self.[]=(name, project_id, v)     project_id = project_id.id if project_id.is_a?(Project)     setting = find_or_default(name, project_id)     setting.value = (v ? v : &quot;&quot;)     @intouch_cached_settings[hk(name, project_id)] = nil     setting.save     setting.value   end    # Checks if settings have changed since the values were read   # and clears the cache hash if it's the case   # Called once per request   def self.check_cache     settings_updated_on = IntouchSetting.maximum(:updated_on)     if settings_updated_on && @intouch_cached_cleared_on &lt;= settings_updated_on       clear_cache     end   end    # Clears the settings cache   def self.clear_cache     @intouch_cached_settings.clear     @intouch_cached_cleared_on = Time.now     logger.info &quot;Intouch settings cache cleared.&quot; if logger   end    load_available_settings     private    def self.hk(name, project_id)     &quot;#{name}-#{project_id.to_s}&quot;   end    def self.find_or_default(name, project_id)     name = name.to_s     raise &quot;There's no setting named #{name}&quot; unless available_settings.has_key?(name)     setting = find_by_name_and_project_id(name, project_id)     unless setting       setting = new(name: name, project_id: project_id)       setting.value = available_settings[name][:default]     end     setting   end    def force_utf8_strings(arg)     if arg.is_a?(String)       arg.dup.force_encoding('UTF-8')     elsif arg.is_a?(Array)       arg.map do |a|         force_utf8_strings(a)       end     elsif arg.is_a?(Hash)       arg = arg.dup       arg.each do |k,v|         arg[k] = force_utf8_strings(v)       end       arg     else       arg     end   end end <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0425\u043e\u0442\u044f \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0438\u0437-\u0437\u0430 \u043d\u0435\u0433\u043e \u043f\u0430\u0434\u0430\u043b\u0430 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a. \u0414\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c.<\/p>\n<h4>\u041a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b?<\/h4>\n<p>  \u041f\u043e \u0445\u043e\u0434\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u043b\u0430 \u043c\u044b\u0441\u043b\u044c, \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0439 \u0432\u0441\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0445\u0435\u0448\u0435. \u041d\u043e \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044f \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043d\u0435 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b Redmine. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <b>projects<\/b>.<\/p>\n<p>  \u041d\u043e \u0432\u0441\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0435\u043b. \u0418 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0439 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0438\u043b\u043e.<\/p>\n<p>  \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043e\u043b\u0435 <b>intouch_settings<\/b> \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <b>projects<\/b>. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \u0438\u0437 \u0438\u043c\u0435\u043d\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432\u0437\u044f\u043b \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435 <b>settings<\/b> \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443.<\/p>\n<p>  \u0418 \u0442\u0443\u0442 \u043d\u0430\u0447\u0430\u043b\u0438\u0441\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043a \u043f\u0430\u0442\u0447\u0443 Project \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c<\/p>\n<pre><code class=\"ruby\">store :intouch_settings,  accessors: %w(telegram_settings email_settings) <\/code><\/pre>\n<p>  \u041f\u043e\u0437\u0436\u0435 \u0432 <b>accessors<\/b> \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0435\u0449\u0451 3 \u043f\u043e\u043b\u044f. \u0423\u0434\u043e\u0431\u043d\u043e \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e!<\/p>\n<p>  \u0410 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043a \u043f\u043b\u0430\u0433\u0438\u043d\u0443, \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0430\u0447\u043d\u044b\u043c!<\/p>\n<h4>\u041a\u0430\u043a \u0436\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0443 \u0432\u0441\u0451 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435?<\/h4>\n<p>  \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043c\u0435\u0442\u043e\u0434 <b>try<\/b>, \u043d\u0430\u043b\u0438\u0447\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432 \u0440\u0435\u043b\u044c\u0441\u0430\u0445.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0451\u043d\u043d\u0443\u044e \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<pre><code>&lt;% IssueStatus.order(:position).each do |status| %&gt;     &lt;tr&gt;       &lt;th&gt;         &lt;%= status.name %&gt;       &lt;\/th&gt;       &lt;% IssuePriority.order(:position).each do |priority| %&gt;         &lt;td&gt;           &lt;% Intouch.active_protocols.each do |protocol| %&gt;             &lt;%= check_box_tag &quot;intouch_settings[#{protocol}_settings][author][#{status.id}][]&quot;, priority.id,                               @project.send(&quot;#{protocol}_settings&quot;).try(:[], 'author').                                   try(:[], status.id.to_s).try(:include?, priority.id.to_s) %&gt;             &lt;%= label_tag l &quot;intouch.protocols.#{protocol}&quot; %&gt;&lt;br&gt;           &lt;% end %&gt;         &lt;\/td&gt;       &lt;% end %&gt;     &lt;\/tr&gt;   &lt;% end %&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0431\u044b\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b, \u0432 \u043f\u043e\u043b\u0435 <b>intouch_settings<\/b> \u0441\u0442\u0430\u043b\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">intouch_settings<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"ruby\">{&quot;settings_template_id&quot;=&gt;&quot;2&quot;,    &quot;telegram_settings&quot;=&gt;     {&quot;author&quot;=&gt;{&quot;1&quot;=&gt;[&quot;2&quot;, &quot;5&quot;], &quot;2&quot;=&gt;[&quot;2&quot;, &quot;5&quot;], &quot;3&quot;=&gt;[&quot;5&quot;], &quot;5&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;]},      &quot;assigned_to&quot;=&gt;       {&quot;1&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],        &quot;2&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],        &quot;3&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],        &quot;4&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],        &quot;5&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],        &quot;6&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;]},      &quot;watchers&quot;=&gt;{&quot;1&quot;=&gt;[&quot;5&quot;], &quot;2&quot;=&gt;[&quot;5&quot;], &quot;3&quot;=&gt;[&quot;5&quot;], &quot;5&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;]},      &quot;groups&quot;=&gt;       {&quot;1&quot;=&gt;{&quot;1&quot;=&gt;[&quot;2&quot;, &quot;5&quot;], &quot;2&quot;=&gt;[&quot;2&quot;, &quot;5&quot;], &quot;3&quot;=&gt;[&quot;5&quot;], &quot;5&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;]},        &quot;2&quot;=&gt;         {&quot;1&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],          &quot;2&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],          &quot;3&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],          &quot;4&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],          &quot;5&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;],          &quot;6&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;]}},      &quot;working&quot;=&gt;{&quot;author&quot;=&gt;&quot;1&quot;, &quot;assigned_to&quot;=&gt;&quot;1&quot;, &quot;watchers&quot;=&gt;&quot;1&quot;, &quot;groups&quot;=&gt;[&quot;1&quot;]},      &quot;feedback&quot;=&gt;{&quot;author&quot;=&gt;&quot;1&quot;, &quot;assigned_to&quot;=&gt;&quot;1&quot;, &quot;watchers&quot;=&gt;&quot;1&quot;, &quot;groups&quot;=&gt;[&quot;1&quot;]},      &quot;unassigned&quot;=&gt;{&quot;author&quot;=&gt;&quot;1&quot;, &quot;watchers&quot;=&gt;&quot;1&quot;, &quot;groups&quot;=&gt;[&quot;1&quot;]},      &quot;overdue&quot;=&gt;{&quot;author&quot;=&gt;&quot;1&quot;, &quot;assigned_to&quot;=&gt;&quot;1&quot;, &quot;watchers&quot;=&gt;&quot;1&quot;, &quot;groups&quot;=&gt;[&quot;1&quot;, &quot;2&quot;]}},    &quot;reminder_settings&quot;=&gt;     {&quot;1&quot;=&gt;{&quot;active&quot;=&gt;&quot;1&quot;, &quot;interval&quot;=&gt;&quot;1&quot;},      &quot;2&quot;=&gt;{&quot;active&quot;=&gt;&quot;1&quot;, &quot;interval&quot;=&gt;&quot;1&quot;},      &quot;3&quot;=&gt;{&quot;active&quot;=&gt;&quot;1&quot;, &quot;interval&quot;=&gt;&quot;1&quot;},      &quot;4&quot;=&gt;{&quot;active&quot;=&gt;&quot;1&quot;, &quot;interval&quot;=&gt;&quot;1&quot;},      &quot;5&quot;=&gt;{&quot;active&quot;=&gt;&quot;1&quot;, &quot;interval&quot;=&gt;&quot;1&quot;}},    &quot;email_settings&quot;=&gt;     {&quot;unassigned&quot;=&gt;{&quot;user_groups&quot;=&gt;[&quot;5&quot;, &quot;9&quot;]},      &quot;overdue&quot;=&gt;{&quot;assigned_to&quot;=&gt;&quot;1&quot;, &quot;watchers&quot;=&gt;&quot;1&quot;, &quot;user_groups&quot;=&gt;[&quot;5&quot;, &quot;9&quot;]}},    &quot;assigner_groups&quot;=&gt;[&quot;5&quot;, &quot;9&quot;]} <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u0418 \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438<\/h4>\n<p>  \u041f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431 \u0435\u0449\u0451 \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041e\u0441\u043e\u0431\u043e \u043f\u044b\u0442\u043b\u0438\u0432\u044b\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c. \u0421 \u043a\u043e\u0434\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/centosadmin\/redmine_intouch\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub<\/a>.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/270615\/\"> http:\/\/habrahabr.ru\/post\/270615\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c <a href=\"https:\/\/github.com\/centosadmin\/redmine_intouch\">redmine_intouch<\/a> \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <a href=\"http:\/\/centos-admin.ru\/\">Centos-admin.ru<\/a>.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u0431\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u0445\u043e\u0447\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0434\u043b\u044f Redmine.<\/p>\n<p>  \u0422.\u043a. \u044d\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0433\u0435\u043c\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u2014 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0441\u0430\u043c\u043e\u0433\u043e Redmine.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u0447\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043d\u0443\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0435\u0439.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/company\/centosadmin\/blog\/270615\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/79c\/569\/743\/79c5697436cc482b90fa2df53f3b4bcb.png\" alt=\"image\"\/><\/a><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430, \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0442\u0440\u0451\u0445 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u0432, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043a\u043b\u0430\u0434\u043e\u043a, \u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u043c\u0430\u0441\u0441\u0430 \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u043e\u0432.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-267967","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=267967"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267967\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=267967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=267967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=267967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}