Sha256: 7b8f1429c19a2d1aad8cd779885909401679d4c5b4f1ddd2aad22893ee4c408e

Contents?: true

Size: 503 Bytes

Versions: 14

Compression:

Stored size: 503 Bytes

Contents

module AASM
  module Generators
    module OrmHelpers

      def model_contents
        if column_name == 'aasm_state'
<<RUBY
  include AASM

  aasm do
  end
RUBY
        else
<<RUBY
  include AASM

  aasm :column => '#{column_name}' do
  end
RUBY
        end
      end

      private

      def model_exists?
        File.exists?(File.join(destination_root, model_path))
      end

      def model_path
        @model_path ||= File.join("app", "models", "#{file_path}.rb")
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
aasm-5.0.1 lib/generators/aasm/orm_helpers.rb
aasm-5.0.0 lib/generators/aasm/orm_helpers.rb
aasm-4.12.3 lib/generators/aasm/orm_helpers.rb
aasm-4.12.2 lib/generators/aasm/orm_helpers.rb
aasm-4.12.1 lib/generators/aasm/orm_helpers.rb
aasm-4.12.0 lib/generators/aasm/orm_helpers.rb
aasm-4.11.1 lib/generators/aasm/orm_helpers.rb
aasm-4.11.0 lib/generators/aasm/orm_helpers.rb
aasm-4.10.1 lib/generators/aasm/orm_helpers.rb
aasm-4.10.0 lib/generators/aasm/orm_helpers.rb
aasm-4.9.0 lib/generators/aasm/orm_helpers.rb
aasm-4.8.0 lib/generators/aasm/orm_helpers.rb
aasm-4.7.0 lib/generators/aasm/orm_helpers.rb
aasm-4.6.0 lib/generators/aasm/orm_helpers.rb