listable_collections 0.1.0 → 4.0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -5
- data/Rakefile +1 -19
- data/lib/listable_collections/railtie.rb +4 -2
- data/lib/listable_collections/version.rb +3 -1
- data/lib/listable_collections.rb +1 -0
- data/test/dummy/bin/bundle +1 -0
- data/test/dummy/bin/rails +1 -0
- data/test/dummy/bin/rake +1 -0
- data/test/dummy/bin/setup +1 -0
- data/test/dummy/config/database.yml.travis +2 -11
- data/test/dummy/config/environments/development.rb +1 -1
- data/test/dummy/config/environments/production.rb +1 -1
- data/test/dummy/config/environments/test.rb +2 -2
- data/test/dummy/config/secrets.yml +2 -2
- data/test/dummy/log/test.log +8 -918
- data/test/dummy/public/404.html +57 -63
- data/test/dummy/public/422.html +57 -63
- data/test/dummy/public/500.html +56 -62
- data/test/test_helper.rb +2 -2
- metadata +3 -7
- data/test/dummy/db/schema.rb +0 -30
- data/test/dummy/log/development.log +0 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d24fa57f2147098a953be884e946953fa76784b1
|
4
|
+
data.tar.gz: 844f27132035fdd47d45ff610c4b1d8a8b674ec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1bc7db6dd7c1f4c60c83ed900c2faaeb0d27ef5681af1386839f590aa740d5190548fb19516ce9f599ce69551545661d715696c8749dcda48ae83bec8fc993d
|
7
|
+
data.tar.gz: 113d599208001932f8516035ef8aa4feb1fc3c4fc7bc3ca87bb30b761e27c1a3cd49e9951d0f4daeadbab6da45917780b5d1af2a89fb8501104843f10d122a90
|
data/README.md
CHANGED
@@ -7,6 +7,14 @@
|
|
7
7
|
|
8
8
|
Makes collections accessible from a string list in rails.
|
9
9
|
|
10
|
+
## Why
|
11
|
+
|
12
|
+
I did this gem to:
|
13
|
+
|
14
|
+
- Easily manage collections from input text field.
|
15
|
+
- Track changes like dirty module in activerecord.
|
16
|
+
- Have callbacks like has_many associations.
|
17
|
+
|
10
18
|
## Install
|
11
19
|
|
12
20
|
Put this line in your Gemfile:
|
@@ -46,7 +54,7 @@ shop.added_products_to_list => ['iMac']
|
|
46
54
|
shop.removed_products_from_list => ['iPod']
|
47
55
|
```
|
48
56
|
|
49
|
-
NOTE:
|
57
|
+
NOTE: Is recommended to do this check before save all at once and not dynamically to avoid multiple queries.
|
50
58
|
|
51
59
|
### Attributes
|
52
60
|
|
@@ -92,10 +100,6 @@ class Shop < ActiveRecord::Base
|
|
92
100
|
end
|
93
101
|
```
|
94
102
|
|
95
|
-
## Contributing
|
96
|
-
|
97
|
-
Because we've limited resources we'll mainly add features and keep a compatibility range close to what we need in our projects. However, contributions are more than welcome if someone wants to make any improvement.
|
98
|
-
|
99
103
|
## Credits
|
100
104
|
|
101
105
|
This gem is maintained and funded by [mmontossi](https://github.com/mmontossi).
|
data/Rakefile
CHANGED
@@ -4,26 +4,8 @@ rescue LoadError
|
|
4
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
5
|
end
|
6
6
|
|
7
|
-
require 'rdoc/task'
|
8
|
-
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = 'ListableCollections'
|
12
|
-
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.rdoc')
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
7
|
Bundler::GemHelper.install_tasks
|
23
8
|
|
24
|
-
APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
|
25
|
-
load 'rails/tasks/engine.rake'
|
26
|
-
|
27
9
|
require 'rake/testtask'
|
28
10
|
|
29
11
|
Rake::TestTask.new(:test) do |t|
|
@@ -31,7 +13,7 @@ Rake::TestTask.new(:test) do |t|
|
|
31
13
|
t.libs << 'test'
|
32
14
|
t.pattern = 'test/**/*_test.rb'
|
33
15
|
t.verbose = false
|
16
|
+
t.warning = false
|
34
17
|
end
|
35
18
|
|
36
|
-
|
37
19
|
task default: :test
|
@@ -1,8 +1,10 @@
|
|
1
1
|
module ListableCollections
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
|
4
|
-
initializer
|
5
|
-
::ActiveRecord::Base.include
|
4
|
+
initializer 'listable_collections.extensions' do
|
5
|
+
::ActiveRecord::Base.include(
|
6
|
+
ListableCollections::Extensions::ActiveRecord::Base
|
7
|
+
)
|
6
8
|
end
|
7
9
|
|
8
10
|
end
|
data/lib/listable_collections.rb
CHANGED
data/test/dummy/bin/bundle
CHANGED
data/test/dummy/bin/rails
CHANGED
data/test/dummy/bin/rake
CHANGED
data/test/dummy/bin/setup
CHANGED
@@ -1,12 +1,3 @@
|
|
1
|
-
mysql: &mysql
|
2
|
-
adapter: <%= 'jdbc' if RUBY_ENGINE == 'jruby' %>mysql<%= '2' if RUBY_ENGINE != 'jruby' %>
|
3
|
-
|
4
|
-
postgres: &postgres
|
5
|
-
adapter: <%= 'jdbc' if RUBY_ENGINE == 'jruby' %>postgresql
|
6
|
-
|
7
|
-
sqlite: &sqlite
|
8
|
-
adapter: <%= 'jdbc' if RUBY_ENGINE == 'jruby' %>sqlite3
|
9
|
-
|
10
1
|
test:
|
11
|
-
|
12
|
-
database:
|
2
|
+
adapter: <%= 'jdbc' if RUBY_ENGINE == 'jruby' %>postgresql
|
3
|
+
database: travis
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
Rails.application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
@@ -17,7 +17,7 @@ Dummy::Application.configure do
|
|
17
17
|
config.static_cache_control = 'public, max-age=3600'
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
20
|
-
config.consider_all_requests_local
|
20
|
+
config.consider_all_requests_local = true
|
21
21
|
config.action_controller.perform_caching = false
|
22
22
|
|
23
23
|
# Raise exceptions instead of rendering exception templates.
|
@@ -11,10 +11,10 @@
|
|
11
11
|
# if you're sharing your code publicly.
|
12
12
|
|
13
13
|
development:
|
14
|
-
secret_key_base:
|
14
|
+
secret_key_base: 2c1c8d4cbaa726b21aa6483b7d556125f4897508e2b94f8b3ddaec675168382c9b3b6eb5a9359d2fade03f539c16ac1ef905891c2410f2fd00b83b76c1666feb
|
15
15
|
|
16
16
|
test:
|
17
|
-
secret_key_base:
|
17
|
+
secret_key_base: 9dd531171128e7c3d11dd2c5c18c84ba43d29b677043002634a6f4d58bf2687a283b7b6dc6af741d63c3824f11fa1f858010d7c2509a932023f2ece0d3bfe6cf
|
18
18
|
|
19
19
|
# Do not keep production secrets in the repository,
|
20
20
|
# instead read values from the environment.
|