listable_collections 0.1.0 → 4.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98beba0b66e56801103e6edf0062ebfa1fc068c7
4
- data.tar.gz: b91c6d3017823ed91e899b60a6b81b599d64748a
3
+ metadata.gz: d24fa57f2147098a953be884e946953fa76784b1
4
+ data.tar.gz: 844f27132035fdd47d45ff610c4b1d8a8b674ec3
5
5
  SHA512:
6
- metadata.gz: 95e85d86a9abf1fb8434210bf844974e9f713b855d497f93666b7b07491fb085ba85677bb81fd7bc5c318e7e304ffb43a32b95317ba28bca956303f711083b88
7
- data.tar.gz: 365f41addc1726642e7dcbd938067a3093f20eb7e0abfc21638c1329f65b3657e2604fab5fd5460f84a40b6ad51940d24421b9ab9fa59f66b05b4c279942770e
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: Because detecting wich record has been removed by an attribute will fire multiple queries, is recommended do this check before save all at once and not dynamically.
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 :listable_collections do
5
- ::ActiveRecord::Base.include Extensions::ActiveRecord::Base
4
+ initializer 'listable_collections.extensions' do
5
+ ::ActiveRecord::Base.include(
6
+ ListableCollections::Extensions::ActiveRecord::Base
7
+ )
6
8
  end
7
9
 
8
10
  end
@@ -1,3 +1,5 @@
1
1
  module ListableCollections
2
- VERSION = '0.1.0'
2
+
3
+ VERSION = '4.0.0.0'
4
+
3
5
  end
@@ -1,6 +1,7 @@
1
1
  require 'listable_collections/builder'
2
2
  require 'listable_collections/extensions/active_record/base'
3
3
  require 'listable_collections/railtie'
4
+ require 'listable_collections/version'
4
5
 
5
6
  module ListableCollections
6
7
  end
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
4
  load Gem.bin_path('bundler', 'bundle')
data/test/dummy/bin/rails CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  APP_PATH = File.expand_path('../../config/application', __FILE__)
3
4
  require_relative '../config/boot'
4
5
  require 'rails/commands'
data/test/dummy/bin/rake CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  require_relative '../config/boot'
3
4
  require 'rake'
4
5
  Rake.application.run
data/test/dummy/bin/setup CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  require 'pathname'
3
4
 
4
5
  # path to your application root.
@@ -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
- <<: *<%= ENV['DB'] %>
12
- database: <%= ENV['DB'] == 'sqlite' ? 'db/travis.sqlite3' : 'travis' %>
2
+ adapter: <%= 'jdbc' if RUBY_ENGINE == 'jruby' %>postgresql
3
+ database: travis
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # Code is not reloaded between requests.
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
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 = true
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: 921ea9f25943669d3a4b0a6c8762cb6a97a00c42732c84b3a4c80900d4f2be79081cad03e0ec8d5d0f2f293874b2bbd04c1444e7a6d6b9147de8f4ffb3acff11
14
+ secret_key_base: 2c1c8d4cbaa726b21aa6483b7d556125f4897508e2b94f8b3ddaec675168382c9b3b6eb5a9359d2fade03f539c16ac1ef905891c2410f2fd00b83b76c1666feb
15
15
 
16
16
  test:
17
- secret_key_base: 0e085a62fbfd58069441e0eb7dd8c3d0a7035017443181a5fba2c04041a03f8d0d427216ac56a51da79125898d125bb9fb8badb48404919fe3188eb309231570
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.