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.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +14 -6
- data/Gemfile +1 -1
- data/MIT-LICENSE +6 -5
- data/README.md +171 -158
- data/Rakefile +4 -9
- data/ci/Gemfile-rails-4-2 +7 -0
- data/ci/Gemfile-rails-5-0 +6 -0
- data/ci/Gemfile-rails-5-1 +6 -0
- data/ci/Gemfile-rails-5-2 +6 -0
- data/ci/Gemfile-rails-6-0 +6 -0
- data/lib/generators/rails_settings/migration/migration_generator.rb +23 -0
- data/lib/generators/rails_settings/migration/templates/migration.rb +21 -0
- data/lib/ledermann-rails-settings.rb +1 -0
- data/lib/rails-settings.rb +21 -5
- data/lib/rails-settings/base.rb +48 -0
- data/lib/rails-settings/configuration.rb +39 -0
- data/lib/rails-settings/scopes.rb +34 -0
- data/lib/rails-settings/setting_object.rb +84 -0
- data/lib/rails-settings/version.rb +2 -2
- data/rails-settings.gemspec +22 -21
- data/spec/configuration_spec.rb +120 -0
- data/spec/database.yml +3 -0
- data/spec/queries_spec.rb +101 -0
- data/spec/scopes_spec.rb +31 -0
- data/spec/serialize_spec.rb +40 -0
- data/spec/setting_object_spec.rb +153 -0
- data/spec/settings_spec.rb +248 -0
- data/spec/spec_helper.rb +111 -0
- data/spec/support/matchers/perform_queries.rb +22 -0
- data/spec/support/query_counter.rb +17 -0
- metadata +130 -118
- data/Changelog.md +0 -17
- data/ci/Gemfile.rails-2.3.x +0 -5
- data/ci/Gemfile.rails-3.0.x +0 -5
- data/ci/Gemfile.rails-3.1.x +0 -5
- data/ci/Gemfile.rails-3.2.x +0 -5
- data/init.rb +0 -1
- data/lib/rails-settings/active_record.rb +0 -38
- data/lib/rails-settings/null_store.rb +0 -48
- data/lib/rails-settings/scoped_settings.rb +0 -14
- data/lib/rails-settings/settings.rb +0 -142
- data/test/settings_test.rb +0 -252
- 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}"
|