has_defaults 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -0
- data/.travis.yml +56 -0
- data/{MIT-LICENSE → LICENSE} +1 -1
- data/README.md +23 -4
- data/Rakefile +5 -29
- data/gemfiles/Gemfile.2.3.mysql2 +13 -0
- data/gemfiles/Gemfile.2.3.mysql2.lock +32 -0
- data/gemfiles/Gemfile.3.2.mysql2 +12 -0
- data/gemfiles/Gemfile.3.2.mysql2.lock +57 -0
- data/gemfiles/Gemfile.4.2.mysql2 +10 -0
- data/gemfiles/Gemfile.4.2.mysql2.lock +61 -0
- data/gemfiles/Gemfile.4.2.pg +10 -0
- data/gemfiles/Gemfile.4.2.pg.lock +61 -0
- data/gemfiles/Gemfile.5.0.mysql2 +10 -0
- data/gemfiles/Gemfile.5.0.mysql2.lock +58 -0
- data/gemfiles/Gemfile.5.0.pg +10 -0
- data/gemfiles/Gemfile.5.0.pg.lock +58 -0
- data/lib/has_defaults.rb +1 -3
- data/lib/has_defaults/active_record_ext.rb +9 -2
- data/lib/has_defaults/version.rb +1 -1
- data/spec/{shared/has_defaults → has_defaults}/active_record_ext_spec.rb +3 -3
- data/spec/spec_helper.rb +18 -0
- data/spec/support/database.rb +16 -0
- data/spec/support/database.sample.yml +10 -0
- data/spec/support/database.travis.yml +9 -0
- data/spec/support/database.yml +10 -0
- data/spec/{shared/app_root/app/models/donut.rb → support/models.rb} +11 -0
- metadata +28 -76
- data/spec/rails-2.3/Gemfile +0 -8
- data/spec/rails-2.3/Gemfile.lock +0 -51
- data/spec/rails-2.3/Rakefile +0 -11
- data/spec/rails-2.3/app_root/config/boot.rb +0 -129
- data/spec/rails-2.3/app_root/config/database.yml +0 -4
- data/spec/rails-2.3/app_root/config/environment.rb +0 -14
- data/spec/rails-2.3/app_root/config/environments/test.rb +0 -28
- data/spec/rails-2.3/app_root/config/preinitializer.rb +0 -20
- data/spec/rails-2.3/app_root/config/routes.rb +0 -4
- data/spec/rails-2.3/app_root/lib/console_with_fixtures.rb +0 -4
- data/spec/rails-2.3/app_root/log/.gitignore +0 -1
- data/spec/rails-2.3/app_root/script/console +0 -7
- data/spec/rails-2.3/rcov.opts +0 -2
- data/spec/rails-2.3/spec.opts +0 -4
- data/spec/rails-2.3/spec_helper.rb +0 -24
- data/spec/rails-3.0/.rspec +0 -2
- data/spec/rails-3.0/Gemfile +0 -9
- data/spec/rails-3.0/Gemfile.lock +0 -101
- data/spec/rails-3.0/Rakefile +0 -10
- data/spec/rails-3.0/app_root/.gitignore +0 -4
- data/spec/rails-3.0/app_root/config/application.rb +0 -32
- data/spec/rails-3.0/app_root/config/boot.rb +0 -13
- data/spec/rails-3.0/app_root/config/database.yml +0 -4
- data/spec/rails-3.0/app_root/config/environment.rb +0 -5
- data/spec/rails-3.0/app_root/config/environments/test.rb +0 -35
- data/spec/rails-3.0/app_root/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails-3.0/app_root/config/initializers/inflections.rb +0 -10
- data/spec/rails-3.0/app_root/config/initializers/mime_types.rb +0 -5
- data/spec/rails-3.0/app_root/config/initializers/secret_token.rb +0 -7
- data/spec/rails-3.0/app_root/config/initializers/session_store.rb +0 -8
- data/spec/rails-3.0/app_root/config/locales/en.yml +0 -5
- data/spec/rails-3.0/app_root/config/routes.rb +0 -58
- data/spec/rails-3.0/app_root/lib/tasks/.gitkeep +0 -0
- data/spec/rails-3.0/app_root/log/.gitkeep +0 -0
- data/spec/rails-3.0/app_root/script/rails +0 -6
- data/spec/rails-3.0/log/in_memory.log +0 -33
- data/spec/rails-3.0/rcov.opts +0 -2
- data/spec/rails-3.0/spec_helper.rb +0 -25
- data/spec/rails-3.2/.rspec +0 -2
- data/spec/rails-3.2/Gemfile +0 -9
- data/spec/rails-3.2/Gemfile.lock +0 -120
- data/spec/rails-3.2/Rakefile +0 -10
- data/spec/rails-3.2/app_root/.gitignore +0 -4
- data/spec/rails-3.2/app_root/config/application.rb +0 -32
- data/spec/rails-3.2/app_root/config/boot.rb +0 -13
- data/spec/rails-3.2/app_root/config/database.yml +0 -4
- data/spec/rails-3.2/app_root/config/environment.rb +0 -5
- data/spec/rails-3.2/app_root/config/environments/test.rb +0 -35
- data/spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails-3.2/app_root/config/initializers/inflections.rb +0 -10
- data/spec/rails-3.2/app_root/config/initializers/mime_types.rb +0 -5
- data/spec/rails-3.2/app_root/config/initializers/secret_token.rb +0 -7
- data/spec/rails-3.2/app_root/config/initializers/session_store.rb +0 -8
- data/spec/rails-3.2/app_root/config/locales/en.yml +0 -5
- data/spec/rails-3.2/app_root/config/routes.rb +0 -58
- data/spec/rails-3.2/app_root/lib/tasks/.gitkeep +0 -0
- data/spec/rails-3.2/app_root/log/.gitkeep +0 -0
- data/spec/rails-3.2/app_root/script/rails +0 -6
- data/spec/rails-3.2/log/in_memory.log +0 -33
- data/spec/rails-3.2/rcov.opts +0 -2
- data/spec/rails-3.2/spec_helper.rb +0 -25
- data/spec/shared/app_root/app/controllers/application_controller.rb +0 -2
- data/spec/shared/app_root/app/models/model_without_defaults.rb +0 -2
- data/spec/shared/app_root/app/models/pastry.rb +0 -6
- data/spec/shared/app_root/db/migrate/001_create_pastries.rb +0 -19
- data/spec/shared/app_root/db/migrate/002_create_model_without_defaults.rb +0 -12
@@ -1,35 +0,0 @@
|
|
1
|
-
HasDefaultSpecApp::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
3
|
-
|
4
|
-
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
8
|
-
config.cache_classes = true
|
9
|
-
|
10
|
-
# Log error messages when you accidentally call methods on nil.
|
11
|
-
config.whiny_nils = true
|
12
|
-
|
13
|
-
# Show full error reports and disable caching
|
14
|
-
config.consider_all_requests_local = true
|
15
|
-
config.action_controller.perform_caching = false
|
16
|
-
|
17
|
-
# Raise exceptions instead of rendering exception templates
|
18
|
-
config.action_dispatch.show_exceptions = false
|
19
|
-
|
20
|
-
# Disable request forgery protection in test environment
|
21
|
-
config.action_controller.allow_forgery_protection = false
|
22
|
-
|
23
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
-
# The :test delivery method accumulates sent emails in the
|
25
|
-
# ActionMailer::Base.deliveries array.
|
26
|
-
config.action_mailer.delivery_method = :test
|
27
|
-
|
28
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
-
# like if you have constraints or database-specific column types
|
31
|
-
# config.active_record.schema_format = :sql
|
32
|
-
|
33
|
-
# Print deprecation notices to the stderr
|
34
|
-
config.active_support.deprecation = :stderr
|
35
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
-
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new inflection rules using the following format
|
4
|
-
# (all these examples are active by default):
|
5
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
-
# inflect.singular /^(ox)en/i, '\1'
|
8
|
-
# inflect.irregular 'person', 'people'
|
9
|
-
# inflect.uncountable %w( fish sheep )
|
10
|
-
# end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
HasDefaultSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
HasDefaultSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
|
4
|
-
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
6
|
-
# which shouldn't be used to store highly confidential information
|
7
|
-
# (create the session table with "rails generate session_migration")
|
8
|
-
# HasDefaultSpecApp::Application.config.session_store :active_record_store
|
@@ -1,58 +0,0 @@
|
|
1
|
-
HasDefaultSpecApp::Application.routes.draw do
|
2
|
-
# The priority is based upon order of creation:
|
3
|
-
# first created -> highest priority.
|
4
|
-
|
5
|
-
# Sample of regular route:
|
6
|
-
# match 'products/:id' => 'catalog#view'
|
7
|
-
# Keep in mind you can assign values other than :controller and :action
|
8
|
-
|
9
|
-
# Sample of named route:
|
10
|
-
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
11
|
-
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
-
|
13
|
-
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
14
|
-
# resources :products
|
15
|
-
|
16
|
-
# Sample resource route with options:
|
17
|
-
# resources :products do
|
18
|
-
# member do
|
19
|
-
# get 'short'
|
20
|
-
# post 'toggle'
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# collection do
|
24
|
-
# get 'sold'
|
25
|
-
# end
|
26
|
-
# end
|
27
|
-
|
28
|
-
# Sample resource route with sub-resources:
|
29
|
-
# resources :products do
|
30
|
-
# resources :comments, :sales
|
31
|
-
# resource :seller
|
32
|
-
# end
|
33
|
-
|
34
|
-
# Sample resource route with more complex sub-resources
|
35
|
-
# resources :products do
|
36
|
-
# resources :comments
|
37
|
-
# resources :sales do
|
38
|
-
# get 'recent', :on => :collection
|
39
|
-
# end
|
40
|
-
# end
|
41
|
-
|
42
|
-
# Sample resource route within a namespace:
|
43
|
-
# namespace :admin do
|
44
|
-
# # Directs /admin/products/* to Admin::ProductsController
|
45
|
-
# # (app/controllers/admin/products_controller.rb)
|
46
|
-
# resources :products
|
47
|
-
# end
|
48
|
-
|
49
|
-
# You can have the root of your site routed with "root"
|
50
|
-
# just remember to delete public/index.html.
|
51
|
-
# root :to => "welcome#index"
|
52
|
-
|
53
|
-
# See how all your routes lay out with "rake routes"
|
54
|
-
|
55
|
-
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
|
-
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
-
match ':controller(/:action(/:id(.:format)))'
|
58
|
-
end
|
File without changes
|
File without changes
|
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby1.8
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
@@ -1,33 +0,0 @@
|
|
1
|
-
[1m[36mSQL (0.3ms)[0m [1m SELECT name
|
2
|
-
FROM sqlite_master
|
3
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
4
|
-
[0m
|
5
|
-
[1m[35mSQL (0.1ms)[0m select sqlite_version(*)
|
6
|
-
[1m[36mSQL (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
7
|
-
[1m[35mSQL (0.0ms)[0m PRAGMA index_list("schema_migrations")
|
8
|
-
[1m[36mSQL (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9
|
-
[1m[35mSQL (0.1ms)[0m SELECT name
|
10
|
-
FROM sqlite_master
|
11
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
12
|
-
[1m[36mSQL (0.3ms)[0m [1m SELECT name
|
13
|
-
FROM sqlite_master
|
14
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
15
|
-
[0m
|
16
|
-
[1m[35mSQL (0.1ms)[0m select sqlite_version(*)
|
17
|
-
[1m[36mSQL (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
18
|
-
[1m[35mSQL (0.0ms)[0m PRAGMA index_list("schema_migrations")
|
19
|
-
[1m[36mSQL (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
20
|
-
[1m[35mSQL (0.1ms)[0m SELECT name
|
21
|
-
FROM sqlite_master
|
22
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
23
|
-
[1m[36mSQL (0.3ms)[0m [1m SELECT name
|
24
|
-
FROM sqlite_master
|
25
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
26
|
-
[0m
|
27
|
-
[1m[35mSQL (0.1ms)[0m select sqlite_version(*)
|
28
|
-
[1m[36mSQL (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
29
|
-
[1m[35mSQL (0.0ms)[0m PRAGMA index_list("schema_migrations")
|
30
|
-
[1m[36mSQL (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
31
|
-
[1m[35mSQL (0.1ms)[0m SELECT name
|
32
|
-
FROM sqlite_master
|
33
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
data/spec/rails-3.2/rcov.opts
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
$: << File.join(File.dirname(__FILE__), "/../lib" )
|
2
|
-
|
3
|
-
# Set the default environment to sqlite3's in_memory database
|
4
|
-
ENV['RAILS_ENV'] ||= 'test'
|
5
|
-
ENV['RAILS_ROOT'] = 'app_root'
|
6
|
-
|
7
|
-
# Load the Rails environment and testing framework
|
8
|
-
require "#{File.dirname(__FILE__)}/app_root/config/environment"
|
9
|
-
require 'rspec/rails'
|
10
|
-
|
11
|
-
# Load dependencies
|
12
|
-
# require 'has_defaults'
|
13
|
-
|
14
|
-
# Require support code
|
15
|
-
# Dir["../shared/support/**/*.rb"].each {|f| require f}
|
16
|
-
|
17
|
-
# Run the migrations
|
18
|
-
print "\033[30m" # dark gray text
|
19
|
-
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
|
20
|
-
print "\033[0m"
|
21
|
-
|
22
|
-
RSpec.configure do |config|
|
23
|
-
config.use_transactional_fixtures = true
|
24
|
-
config.use_instantiated_fixtures = false
|
25
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class CreatePastries < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
4
|
-
create_table :pastries do |t|
|
5
|
-
t.string :type
|
6
|
-
t.string :flavor
|
7
|
-
t.string :name
|
8
|
-
t.string :maker
|
9
|
-
t.string :weight
|
10
|
-
t.string :main_ingredient
|
11
|
-
t.string :health_benefits
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.down
|
16
|
-
drop_table :pastries
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|