Sha256: 4cdce74827c3bff97278679da84fb6e95cc46feb4f9101d4e715ad104569c48e

Contents?: true

Size: 614 Bytes

Versions: 35

Compression:

Stored size: 614 Bytes

Contents

module Rails
  module Generator
    class GeneratedAttribute
      def default_value
        @default_value ||= case type
          when :int, :integer               then "1"
          when :float                       then "1.5"
          when :decimal                     then "9.99"
          when :datetime, :timestamp, :time then "Time.now"
          when :date                        then "Date.today"
          when :string, :text               then "\"value for #{@name}\""
          when :boolean                     then "false"
          else
            ""
        end      
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 5 rubygems

Version Path
cavalle-rspec-rails-1.2.2.0.1 generators/rspec_default_values.rb
cavalle-rspec-rails-1.2.2.0.2 generators/rspec_default_values.rb
cavalle-rspec-rails-1.2.3.1 generators/rspec_default_values.rb
cavalle-rspec-rails-1.2.4.0.1 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.11.2 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.11.3 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.11.4 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.11.5 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.11.6 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.11.7 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.12 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.1 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.13 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.2 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.3 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.4 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.5 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.6 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.7 generators/rspec_default_values.rb
dchelimsky-rspec-rails-1.1.99.8 generators/rspec_default_values.rb