ledermann-rails-settings 1.2.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.travis.yml +14 -6
  4. data/Gemfile +1 -1
  5. data/MIT-LICENSE +6 -5
  6. data/README.md +171 -158
  7. data/Rakefile +4 -9
  8. data/ci/Gemfile-rails-4-2 +7 -0
  9. data/ci/Gemfile-rails-5-0 +6 -0
  10. data/ci/Gemfile-rails-5-1 +6 -0
  11. data/ci/Gemfile-rails-5-2 +6 -0
  12. data/ci/Gemfile-rails-6-0 +6 -0
  13. data/lib/generators/rails_settings/migration/migration_generator.rb +23 -0
  14. data/lib/generators/rails_settings/migration/templates/migration.rb +21 -0
  15. data/lib/ledermann-rails-settings.rb +1 -0
  16. data/lib/rails-settings.rb +21 -5
  17. data/lib/rails-settings/base.rb +48 -0
  18. data/lib/rails-settings/configuration.rb +39 -0
  19. data/lib/rails-settings/scopes.rb +34 -0
  20. data/lib/rails-settings/setting_object.rb +84 -0
  21. data/lib/rails-settings/version.rb +2 -2
  22. data/rails-settings.gemspec +22 -21
  23. data/spec/configuration_spec.rb +120 -0
  24. data/spec/database.yml +3 -0
  25. data/spec/queries_spec.rb +101 -0
  26. data/spec/scopes_spec.rb +31 -0
  27. data/spec/serialize_spec.rb +40 -0
  28. data/spec/setting_object_spec.rb +153 -0
  29. data/spec/settings_spec.rb +248 -0
  30. data/spec/spec_helper.rb +111 -0
  31. data/spec/support/matchers/perform_queries.rb +22 -0
  32. data/spec/support/query_counter.rb +17 -0
  33. metadata +130 -118
  34. data/Changelog.md +0 -17
  35. data/ci/Gemfile.rails-2.3.x +0 -5
  36. data/ci/Gemfile.rails-3.0.x +0 -5
  37. data/ci/Gemfile.rails-3.1.x +0 -5
  38. data/ci/Gemfile.rails-3.2.x +0 -5
  39. data/init.rb +0 -1
  40. data/lib/rails-settings/active_record.rb +0 -38
  41. data/lib/rails-settings/null_store.rb +0 -48
  42. data/lib/rails-settings/scoped_settings.rb +0 -14
  43. data/lib/rails-settings/settings.rb +0 -142
  44. data/test/settings_test.rb +0 -252
  45. data/test/test_helper.rb +0 -34
data/test/test_helper.rb DELETED
@@ -1,34 +0,0 @@
1
- require 'rubygems'
2
-
3
- require 'active_support'
4
- require 'active_support/test_case'
5
- require 'active_record'
6
- require 'test/unit'
7
-
8
- require "#{File.dirname(__FILE__)}/../init"
9
-
10
- ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
11
- ActiveRecord::Migration.verbose = false
12
-
13
- class User < ActiveRecord::Base
14
- has_settings
15
- end
16
-
17
- def setup_db
18
- ActiveRecord::Schema.define(:version => 1) do
19
- create_table :settings do |t|
20
- t.string :var, :null => false
21
- t.text :value, :null => true
22
- t.integer :target_id, :null => true
23
- t.string :target_type, :limit => 30, :null => true
24
- t.timestamps
25
- end
26
- add_index :settings, [ :target_type, :target_id, :var ], :unique => true
27
-
28
- create_table :users do |t|
29
- t.string :name
30
- end
31
- end
32
- end
33
-
34
- puts "Testing with ActiveRecord #{ActiveRecord::VERSION::STRING}"