Sha256: a325b0c583b2befc321cd46776a7e00022f783ff33f013eec6fb197454b256a5

Contents?: true

Size: 632 Bytes

Versions: 69

Compression:

Stored size: 632 Bytes

Contents

# encoding: utf-8
require "rails/generators/named_base"
require "rails/generators/active_model"

module Mongoid
  module Generators
    class Base < ::Rails::Generators::NamedBase

      def self.source_root
        @_mongoid_source_root ||=
          File.expand_path("../#{base_name}/#{generator_name}/templates", __FILE__)
      end
    end
  end
end

module Rails
  module Generators
    class GeneratedAttribute
      def type_class
        return "Time" if type == :datetime
        return "String" if type == :text
        return "Mongoid::Boolean" if type == :boolean
        type.to_s.camelcase
      end
    end
  end
end

Version data entries

69 entries across 64 versions & 3 rubygems

Version Path
mongoid-7.0.13 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.12 lib/rails/generators/mongoid_generator.rb
mongoid-6.4.8 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.11 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.10 lib/rails/generators/mongoid_generator.rb
mongoid-6.4.7 lib/rails/generators/mongoid_generator.rb
mongoid-6.4.5 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.8 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.7 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.6 lib/rails/generators/mongoid_generator.rb
mongoid-5.4.1 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.5 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.4 lib/rails/generators/mongoid_generator.rb
mongoid-6.4.4 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.3 lib/rails/generators/mongoid_generator.rb
mongoid-6.4.2 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.2 lib/rails/generators/mongoid_generator.rb
mongoid-7.0.1 lib/rails/generators/mongoid_generator.rb
mongoid-6.4.1 lib/rails/generators/mongoid_generator.rb
mongoid-5.4.0 lib/rails/generators/mongoid_generator.rb