Sha256: 6db785fdef221fadf6dbd8a7e73f678786da290fb15788428f922d4726d9bea6
Contents?: true
Size: 866 Bytes
Versions: 5
Compression:
Stored size: 866 Bytes
Contents
rails_major_version = Rails::VERSION::STRING[0].to_i # Add our local pubsub_notifier to the load path inject_into_file "config/environment.rb", "\n$LOAD_PATH.unshift('#{File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib"))}')\nrequire \"approval\"\n", after: (rails_major_version >= 5) ? "require_relative 'application'" : "require File.expand_path('../application', __FILE__)" run "rm Gemfile" $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib")) # Install generate :'approval:install' # Generate ActiveRecord Models generate :model, "User name:string" inject_into_file "app/models/user.rb", " acts_as_approval_user\n", before: "end" generate :model, "Book name:string" inject_into_file "app/models/book.rb", " acts_as_approval_resource\n", before: "end" run "rm -r spec" rake "db:migrate"
Version data entries
5 entries across 5 versions & 1 rubygems