Sha256: 2a6797c74de2decb3c5c93c2fb00006098f47cba9b2701f927322fdc8d393232

Contents?: true

Size: 417 Bytes

Versions: 9

Compression:

Stored size: 417 Bytes

Contents

require 'rails/generators/active_record'

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

      source_root File.expand_path("../templates", __FILE__)

      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

9 entries across 8 versions & 4 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/rails-observers-0.1.5/lib/generators/active_record/observer/observer_generator.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/rails-observers-0.1.5/lib/generators/active_record/observer/observer_generator.rb
rails-observers-0.1.5 lib/generators/active_record/observer/observer_generator.rb
rails-observers-0.1.4 lib/generators/active_record/observer/observer_generator.rb
rails-observers-hp-0.1.3 lib/generators/active_record/observer/observer_generator.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/rails-observers-0.1.2/lib/generators/active_record/observer/observer_generator.rb
rails-observers-0.1.2 lib/generators/active_record/observer/observer_generator.rb
rails-observers-0.1.1 lib/generators/active_record/observer/observer_generator.rb
rails-observers-0.1.0 lib/generators/active_record/observer/observer_generator.rb