public_activity_multi_recipients 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/activity_decorator.rb +4 -0
- data/app/models/activity_recipient.rb +3 -0
- data/db/migrate/20170221061503_create_activity_recipients.rb +1 -1
- data/lib/public_activity_multi_recipients/engine.rb +14 -0
- data/lib/public_activity_multi_recipients/version.rb +1 -1
- metadata +2 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 50fcf5ae225b96ed8084240a4bcf0681488faef5
         | 
| 4 | 
            +
              data.tar.gz: 345f6e0104dc7a3883e21e20411420c9ef215847
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 1e3740b94a468330afc357beb1bc652768253df610f90e75666213c283c5b596554c850c8baed790319275b80ee5789f19261c6eb491275db79254c6c39ab6cc
         | 
| 7 | 
            +
              data.tar.gz: 3b6cc164b6f894a7a6ddeee5d5fc81e44d64382b615fe65f769f5e6e4e90b382cc4c803d6c6e710f24d08a158e57b9ffedaa5034dbb41889b4fb58760534d6b4
         | 
| @@ -2,7 +2,7 @@ class CreateActivityRecipients < ActiveRecord::Migration[5.0] | |
| 2 2 | 
             
              def change
         | 
| 3 3 | 
             
                create_table :activity_recipients do |t|
         | 
| 4 4 | 
             
                  t.references :activity, index: true
         | 
| 5 | 
            -
                  t.references :recipient,  | 
| 5 | 
            +
                  t.references :recipient, polymorphic: true, index: true
         | 
| 6 6 | 
             
                  t.timestamps
         | 
| 7 7 | 
             
                end
         | 
| 8 8 | 
             
              end
         | 
| @@ -1,4 +1,18 @@ | |
| 1 1 | 
             
            module PublicActivityMultiRecipients
         | 
| 2 2 | 
             
              class Engine < ::Rails::Engine
         | 
| 3 | 
            +
                config.autoload_paths += %W(#{config.root}/lib)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                class << self
         | 
| 6 | 
            +
                  def activate
         | 
| 7 | 
            +
                    ['app', 'lib'].each do |dir|
         | 
| 8 | 
            +
                      file = File.join(File.dirname(__FILE__), "../../#{dir}/**/*_decorator*.rb")
         | 
| 9 | 
            +
                      Dir.glob(file) do |c|
         | 
| 10 | 
            +
                        Rails.application.config.cache_classes ? require(c) : load(c)
         | 
| 11 | 
            +
                      end
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    config.to_prepare &method(:activate).to_proc
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
                end
         | 
| 3 17 | 
             
              end
         | 
| 4 18 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: public_activity_multi_recipients
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - kooinam
         | 
| @@ -49,6 +49,7 @@ files: | |
| 49 49 | 
             
            - README.md
         | 
| 50 50 | 
             
            - Rakefile
         | 
| 51 51 | 
             
            - app/assets/config/public_activity_multi_recipients_manifest.js
         | 
| 52 | 
            +
            - app/models/activity_decorator.rb
         | 
| 52 53 | 
             
            - app/models/activity_recipient.rb
         | 
| 53 54 | 
             
            - app/models/application_record.rb
         | 
| 54 55 | 
             
            - config/routes.rb
         |