Sha256: 88bb10c7ad5f766b449d03a113d5a13e25136ff41dc73b8d7a09ad8d36f32b1f

Contents?: true

Size: 355 Bytes

Versions: 236

Compression:

Stored size: 355 Bytes

Contents

require 'rails/generators/active_record'

module ActiveRecord
  module Generators
    class ObserverGenerator < Base
      check_class_collision :suffix => "Observer"

      def create_observer_file
        template 'observer.rb', File.join('app/models', class_path, "#{file_name}_observer.rb")
      end

      hook_for :test_framework
    end
  end
end

Version data entries

236 entries across 205 versions & 16 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/activerecord-3.2.22.5/lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.22.5 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.22.4 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.22.3 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.22.2 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.22.1 lib/rails/generators/active_record/observer/observer_generator.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.22 lib/rails/generators/active_record/observer/observer_generator.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.12/lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.21 lib/rails/generators/active_record/observer/observer_generator.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/activerecord-3.2.18/lib/rails/generators/active_record/observer/observer_generator.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/rails/generators/active_record/observer/observer_generator.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/rails/generators/active_record/observer/observer_generator.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/activerecord-3.2.18/lib/rails/generators/active_record/observer/observer_generator.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.18/lib/rails/generators/active_record/observer/observer_generator.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.18/lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.20 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.19 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.18 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.17 lib/rails/generators/active_record/observer/observer_generator.rb