assignable_values 0.11.3 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/.gitignore +1 -0
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +41 -9
  4. data/Gemfile +16 -0
  5. data/Gemfile.lock +70 -0
  6. data/README.md +16 -5
  7. data/Rakefile +5 -69
  8. data/assignable_values.gemspec +2 -7
  9. data/gemfiles/Gemfile.2.3 +16 -0
  10. data/gemfiles/Gemfile.2.3.lock +40 -0
  11. data/gemfiles/Gemfile.3.2 +16 -0
  12. data/gemfiles/Gemfile.3.2.lock +65 -0
  13. data/gemfiles/Gemfile.4.2 +16 -0
  14. data/gemfiles/Gemfile.4.2.lock +70 -0
  15. data/gemfiles/Gemfile.5.0 +16 -0
  16. data/gemfiles/Gemfile.5.0.lock +67 -0
  17. data/lib/assignable_values/active_record/restriction/base.rb +5 -5
  18. data/lib/assignable_values/active_record/restriction/belongs_to_association.rb +1 -1
  19. data/lib/assignable_values/active_record/restriction/scalar_attribute.rb +4 -4
  20. data/lib/assignable_values/version.rb +1 -1
  21. data/spec/{shared/assignable_values → assignable_values}/active_record_spec.rb +3 -1
  22. data/spec/{shared/assignable_values → assignable_values}/humanized_value_spec.rb +0 -0
  23. data/spec/spec_helper.rb +19 -0
  24. data/spec/support/database.rb +16 -0
  25. data/spec/support/database.sample.yml +5 -0
  26. data/spec/support/database.travis.yml +4 -0
  27. data/spec/{shared/app_root/config/locales/en.yml → support/i18n.yml} +0 -0
  28. data/spec/support/models.rb +20 -0
  29. metadata +36 -226
  30. data/spec/rails-2.3/.bundle/config +0 -2
  31. data/spec/rails-2.3/Gemfile +0 -14
  32. data/spec/rails-2.3/Gemfile.lock +0 -68
  33. data/spec/rails-2.3/Rakefile +0 -11
  34. data/spec/rails-2.3/app_root/config/boot.rb +0 -129
  35. data/spec/rails-2.3/app_root/config/database.yml +0 -4
  36. data/spec/rails-2.3/app_root/config/environment.rb +0 -14
  37. data/spec/rails-2.3/app_root/config/environments/test.rb +0 -28
  38. data/spec/rails-2.3/app_root/config/preinitializer.rb +0 -20
  39. data/spec/rails-2.3/app_root/config/routes.rb +0 -4
  40. data/spec/rails-2.3/app_root/lib/console_with_fixtures.rb +0 -4
  41. data/spec/rails-2.3/app_root/log/.gitignore +0 -1
  42. data/spec/rails-2.3/app_root/script/console +0 -7
  43. data/spec/rails-2.3/rcov.opts +0 -2
  44. data/spec/rails-2.3/spec.opts +0 -4
  45. data/spec/rails-2.3/spec/spec_helper.rb +0 -25
  46. data/spec/rails-3.2/.bundle/config +0 -2
  47. data/spec/rails-3.2/.rspec +0 -2
  48. data/spec/rails-3.2/Gemfile +0 -10
  49. data/spec/rails-3.2/Gemfile.lock +0 -132
  50. data/spec/rails-3.2/Rakefile +0 -10
  51. data/spec/rails-3.2/app_root/.gitignore +0 -4
  52. data/spec/rails-3.2/app_root/config/application.rb +0 -32
  53. data/spec/rails-3.2/app_root/config/boot.rb +0 -13
  54. data/spec/rails-3.2/app_root/config/database.yml +0 -4
  55. data/spec/rails-3.2/app_root/config/environment.rb +0 -5
  56. data/spec/rails-3.2/app_root/config/environments/test.rb +0 -35
  57. data/spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb +0 -7
  58. data/spec/rails-3.2/app_root/config/initializers/inflections.rb +0 -10
  59. data/spec/rails-3.2/app_root/config/initializers/mime_types.rb +0 -5
  60. data/spec/rails-3.2/app_root/config/initializers/secret_token.rb +0 -7
  61. data/spec/rails-3.2/app_root/config/initializers/session_store.rb +0 -8
  62. data/spec/rails-3.2/app_root/config/routes.rb +0 -58
  63. data/spec/rails-3.2/app_root/lib/tasks/.gitkeep +0 -0
  64. data/spec/rails-3.2/app_root/log/.gitkeep +0 -0
  65. data/spec/rails-3.2/app_root/script/rails +0 -6
  66. data/spec/rails-3.2/rcov.opts +0 -2
  67. data/spec/rails-3.2/spec/spec_helper.rb +0 -25
  68. data/spec/rails-4.1/.bundle/config +0 -2
  69. data/spec/rails-4.1/.rspec +0 -2
  70. data/spec/rails-4.1/.ruby-version +0 -1
  71. data/spec/rails-4.1/Gemfile +0 -16
  72. data/spec/rails-4.1/Gemfile.lock +0 -146
  73. data/spec/rails-4.1/Rakefile +0 -12
  74. data/spec/rails-4.1/app_root/.gitignore +0 -16
  75. data/spec/rails-4.1/app_root/bin/bundle +0 -3
  76. data/spec/rails-4.1/app_root/bin/rails +0 -8
  77. data/spec/rails-4.1/app_root/bin/rake +0 -8
  78. data/spec/rails-4.1/app_root/bin/spring +0 -18
  79. data/spec/rails-4.1/app_root/config/application.rb +0 -28
  80. data/spec/rails-4.1/app_root/config/boot.rb +0 -4
  81. data/spec/rails-4.1/app_root/config/database.yml +0 -4
  82. data/spec/rails-4.1/app_root/config/environment.rb +0 -5
  83. data/spec/rails-4.1/app_root/config/environments/development.rb +0 -37
  84. data/spec/rails-4.1/app_root/config/environments/production.rb +0 -83
  85. data/spec/rails-4.1/app_root/config/environments/test.rb +0 -39
  86. data/spec/rails-4.1/app_root/config/initializers/backtrace_silencers.rb +0 -7
  87. data/spec/rails-4.1/app_root/config/initializers/cookies_serializer.rb +0 -3
  88. data/spec/rails-4.1/app_root/config/initializers/filter_parameter_logging.rb +0 -4
  89. data/spec/rails-4.1/app_root/config/initializers/inflections.rb +0 -16
  90. data/spec/rails-4.1/app_root/config/initializers/mime_types.rb +0 -4
  91. data/spec/rails-4.1/app_root/config/initializers/session_store.rb +0 -3
  92. data/spec/rails-4.1/app_root/config/initializers/wrap_parameters.rb +0 -14
  93. data/spec/rails-4.1/app_root/config/routes.rb +0 -3
  94. data/spec/rails-4.1/app_root/config/secrets.yml +0 -22
  95. data/spec/rails-4.1/rcov.opts +0 -2
  96. data/spec/rails-4.1/spec/spec_helper.rb +0 -25
  97. data/spec/shared/app_root/app/controllers/application_controller.rb +0 -2
  98. data/spec/shared/app_root/app/helpers/application_helper.rb +0 -3
  99. data/spec/shared/app_root/app/models/artist.rb +0 -5
  100. data/spec/shared/app_root/app/models/recording/vinyl.rb +0 -5
  101. data/spec/shared/app_root/app/models/song.rb +0 -7
  102. data/spec/shared/app_root/config/database.yml +0 -4
  103. data/spec/shared/app_root/db/migrate/001_create_artists.rb +0 -11
  104. data/spec/shared/app_root/db/migrate/002_create_songs.rb +0 -16
  105. data/spec/shared/app_root/db/migrate/003_create_recordings.rb +0 -13
@@ -1,10 +0,0 @@
1
- require 'rake'
2
- require 'rspec/core/rake_task'
3
-
4
- desc 'Default: Run all specs for a specific rails version.'
5
- task :default => :spec
6
-
7
- desc "Run all specs for a specific rails version"
8
- RSpec::Core::RakeTask.new(:spec) do |t|
9
- t.pattern = defined?(SPEC) ? SPEC : ['**/*_spec.rb', '../shared/**/*_spec.rb']
10
- end
@@ -1,4 +0,0 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/**/*
@@ -1,32 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- # If you have a Gemfile, require the gems listed there, including any gems
6
- # you've limited to :test, :development, or :production.
7
- Bundler.require(:default, Rails.env) if defined?(Bundler)
8
-
9
-
10
- module SpecApp
11
- class Application < Rails::Application
12
- config.encoding = "utf-8"
13
-
14
- config.cache_classes = true
15
- config.whiny_nils = true
16
-
17
- config.consider_all_requests_local = true
18
- config.action_controller.perform_caching = false
19
-
20
- config.action_dispatch.show_exceptions = false
21
-
22
- config.action_controller.allow_forgery_protection = false
23
-
24
- config.action_mailer.delivery_method = :test
25
-
26
- config.active_support.deprecation = :stderr
27
-
28
- config.root = File.expand_path('../..', __FILE__)
29
-
30
- # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__))
31
- end
32
- end
@@ -1,13 +0,0 @@
1
- require 'rubygems'
2
-
3
- # Set up gems listed in the Gemfile.
4
- gemfile = File.expand_path('../../Gemfile', __FILE__)
5
- begin
6
- ENV['BUNDLE_GEMFILE'] = gemfile
7
- require 'bundler'
8
- Bundler.setup
9
- rescue Bundler::GemNotFound => e
10
- STDERR.puts e.message
11
- STDERR.puts "Try running `bundle install`."
12
- exit!
13
- end if File.exist?(gemfile)
@@ -1,4 +0,0 @@
1
- test:
2
- adapter: sqlite3
3
- database: ":memory:"
4
- verbosity: quiet
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- SpecApp::Application.initialize!
@@ -1,35 +0,0 @@
1
- SpecApp::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,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -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
- SpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- SpecApp::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
- # SpecApp::Application.config.session_store :active_record_store
@@ -1,58 +0,0 @@
1
- SpecApp::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
@@ -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,2 +0,0 @@
1
- --exclude "spec/*,gems/*"
2
- --rails
@@ -1,25 +0,0 @@
1
- $: << File.join(File.dirname(__FILE__), "/../../lib" )
2
-
3
- ENV['RAILS_ENV'] = 'test'
4
- ENV['RAILS_ROOT'] = 'app_root'
5
-
6
- # Load the Rails environment and testing framework
7
- require "#{File.dirname(__FILE__)}/../app_root/config/environment"
8
- require 'rspec/rails'
9
- require 'rspec_candy/all'
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,2 +0,0 @@
1
- ---
2
- BUNDLE_WITHOUT: development
@@ -1,2 +0,0 @@
1
- --colour
2
- --format progress
@@ -1 +0,0 @@
1
- 2.1.0
@@ -1,16 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'sqlite3'
4
- gem 'rails', '4.1.0'
5
- gem 'minitest' # fix MiniTest deprecation warnings
6
- gem 'rspec'
7
- gem 'rspec-rails'
8
- gem 'rspec_candy'
9
- gem 'rspec-collection_matchers' # support for ...should have(n).errors_on ...
10
-
11
- gem 'assignable_values', :path => '../..'
12
-
13
- group :development do
14
- gem 'debugger', platform: 'ruby_19'
15
- gem 'ruby-debug', :platforms => :ruby_18
16
- end
@@ -1,146 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- assignable_values (0.11.2)
5
- activerecord
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actionmailer (4.1.0)
11
- actionpack (= 4.1.0)
12
- actionview (= 4.1.0)
13
- mail (~> 2.5.4)
14
- actionpack (4.1.0)
15
- actionview (= 4.1.0)
16
- activesupport (= 4.1.0)
17
- rack (~> 1.5.2)
18
- rack-test (~> 0.6.2)
19
- actionview (4.1.0)
20
- activesupport (= 4.1.0)
21
- builder (~> 3.1)
22
- erubis (~> 2.7.0)
23
- activemodel (4.1.0)
24
- activesupport (= 4.1.0)
25
- builder (~> 3.1)
26
- activerecord (4.1.0)
27
- activemodel (= 4.1.0)
28
- activesupport (= 4.1.0)
29
- arel (~> 5.0.0)
30
- activesupport (4.1.0)
31
- i18n (~> 0.6, >= 0.6.9)
32
- json (~> 1.7, >= 1.7.7)
33
- minitest (~> 5.1)
34
- thread_safe (~> 0.1)
35
- tzinfo (~> 1.1)
36
- arel (5.0.1.20140414130214)
37
- builder (3.2.2)
38
- columnize (0.3.6)
39
- debugger (1.6.3)
40
- columnize (>= 0.3.1)
41
- debugger-linecache (~> 1.2.0)
42
- debugger-ruby_core_source (~> 1.2.4)
43
- debugger-linecache (1.2.0)
44
- debugger-ruby_core_source (1.2.4)
45
- diff-lcs (1.2.5)
46
- erubis (2.7.0)
47
- hike (1.2.3)
48
- i18n (0.6.9)
49
- json (1.8.1)
50
- linecache (0.46)
51
- rbx-require-relative (> 0.0.4)
52
- mail (2.5.4)
53
- mime-types (~> 1.16)
54
- treetop (~> 1.4.8)
55
- mime-types (1.25.1)
56
- minitest (5.3.4)
57
- multi_json (1.10.1)
58
- polyglot (0.3.5)
59
- rack (1.5.2)
60
- rack-test (0.6.2)
61
- rack (>= 1.0)
62
- rails (4.1.0)
63
- actionmailer (= 4.1.0)
64
- actionpack (= 4.1.0)
65
- actionview (= 4.1.0)
66
- activemodel (= 4.1.0)
67
- activerecord (= 4.1.0)
68
- activesupport (= 4.1.0)
69
- bundler (>= 1.3.0, < 2.0)
70
- railties (= 4.1.0)
71
- sprockets-rails (~> 2.0)
72
- railties (4.1.0)
73
- actionpack (= 4.1.0)
74
- activesupport (= 4.1.0)
75
- rake (>= 0.8.7)
76
- thor (>= 0.18.1, < 2.0)
77
- rake (10.3.2)
78
- rbx-require-relative (0.0.9)
79
- rspec (3.0.0)
80
- rspec-core (~> 3.0.0)
81
- rspec-expectations (~> 3.0.0)
82
- rspec-mocks (~> 3.0.0)
83
- rspec-collection_matchers (1.0.0)
84
- rspec-expectations (>= 2.99.0.beta1)
85
- rspec-core (3.0.0)
86
- rspec-support (~> 3.0.0)
87
- rspec-expectations (3.0.0)
88
- diff-lcs (>= 1.2.0, < 2.0)
89
- rspec-support (~> 3.0.0)
90
- rspec-mocks (3.0.0)
91
- rspec-support (~> 3.0.0)
92
- rspec-rails (3.0.0)
93
- actionpack (>= 3.0)
94
- activesupport (>= 3.0)
95
- railties (>= 3.0)
96
- rspec-core (~> 3.0.0)
97
- rspec-expectations (~> 3.0.0)
98
- rspec-mocks (~> 3.0.0)
99
- rspec-support (~> 3.0.0)
100
- rspec-support (3.0.0)
101
- rspec_candy (0.3.1)
102
- rspec
103
- sneaky-save
104
- ruby-debug (0.10.4)
105
- columnize (>= 0.1)
106
- ruby-debug-base (~> 0.10.4.0)
107
- ruby-debug-base (0.10.4)
108
- linecache (>= 0.3)
109
- sneaky-save (0.0.5)
110
- activerecord (>= 3.2.0)
111
- sprockets (2.11.0)
112
- hike (~> 1.2)
113
- multi_json (~> 1.0)
114
- rack (~> 1.0)
115
- tilt (~> 1.1, != 1.3.0)
116
- sprockets-rails (2.1.3)
117
- actionpack (>= 3.0)
118
- activesupport (>= 3.0)
119
- sprockets (~> 2.8)
120
- sqlite3 (1.3.9)
121
- thor (0.19.1)
122
- thread_safe (0.3.4)
123
- tilt (1.4.1)
124
- treetop (1.4.15)
125
- polyglot
126
- polyglot (>= 0.3.1)
127
- tzinfo (1.2.1)
128
- thread_safe (~> 0.1)
129
-
130
- PLATFORMS
131
- ruby
132
-
133
- DEPENDENCIES
134
- assignable_values!
135
- debugger
136
- minitest
137
- rails (= 4.1.0)
138
- rspec
139
- rspec-collection_matchers
140
- rspec-rails
141
- rspec_candy
142
- ruby-debug
143
- sqlite3
144
-
145
- BUNDLED WITH
146
- 1.12.5
@@ -1,12 +0,0 @@
1
- require 'rake'
2
- require 'rspec/core/rake_task'
3
-
4
- desc 'Default: Run all specs for a specific rails version.'
5
- task :default => :spec
6
-
7
- desc "Run all specs for a specific rails version"
8
- RSpec::Core::RakeTask.new(:spec) do |t|
9
- t.pattern = defined?(SPEC) ? SPEC : ['**/*_spec.rb', '../shared/**/*_spec.rb']
10
- t.verbose = false
11
- # t.rspec_opts = '--backtrace'
12
- end