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
activerecord-3.2.16 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.15 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.15.rc3 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.15.rc2 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.15.rc1 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.14 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.14.rc2 lib/rails/generators/active_record/observer/observer_generator.rb
activerecord-3.2.14.rc1 lib/rails/generators/active_record/observer/observer_generator.rb
swipe-rails-0.0.5 vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/observer/observer_generator.rb
active_mailer-0.0.9 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
active_mailer-0.0.8 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
active_mailer-0.0.7 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
active_mailer-0.0.6 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
challah-1.0.0.beta3 vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/observer/observer_generator.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/rails/generators/active_record/observer/observer_generator.rb
challah-1.0.0.beta2 vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/observer/observer_generator.rb
challah-1.0.0.beta vendor/bundle/gems/activerecord-3.2.11/lib/rails/generators/active_record/observer/observer_generator.rb
challah-1.0.0.beta vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/observer/observer_generator.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/rails/generators/active_record/observer/observer_generator.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/rails/generators/active_record/observer/observer_generator.rb