closure_tree 4.2.1 → 4.2.2

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: 78c02789c9a49942f41eea1ce0ce205d38f1df9a
4
- data.tar.gz: dcad9031af038ee30c9ec61a0f60941c028536f2
3
+ metadata.gz: b7af59d338586f417b0d1c02f5a235cb6f62e6d8
4
+ data.tar.gz: 91940db8a3f150178fd1937aa2a810d11370c32a
5
5
  SHA512:
6
- metadata.gz: 31034ae207d81917f3e60d69312c80561d21382123be62fb0b753db933f420be6007b5d69438c37b2ecd9800a38310ee184c3f9b570312d7d27cc0adc03971ab
7
- data.tar.gz: 2068b5ecf26b41e96cb339a0e14427e6e6baa0527180dce781bd5f10d179662ac8b45b5f9232d5a2413fbf43c72f3a7ee42a0f2f745f95f2851711827b8a1bb3
6
+ metadata.gz: 746919295c964e6d86940068405f4b955751540d56916ab44a3a4a9277c4862ac570fb5527717a6fe889f8786167d008138ca142558137c348dd205b443d6dfe
7
+ data.tar.gz: dde679414da16f0bd2d84bb4ebab7f4a755c4dcee9c0eea91ab81106ebc89fd3040e45b0bded9bd76bf9d9d8db853e408aa0bbaabe33aa2cc21bbd361e0a441d
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Matthew McEachen
1
+ Copyright (c) 2012-2013 Matthew McEachen
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -25,7 +25,7 @@ closure_tree has some great features:
25
25
  * __Best-in-class mutation performance__:
26
26
  * 2 SQL INSERTs on node creation
27
27
  * 3 SQL INSERT/UPDATEs on node reparenting
28
- * __Support for Rails 3.0, 3.1, 3.2, and 4.0.0.rc1__
28
+ * __Support for Rails 3.0, 3.1, 3.2, and 4.0.0.rc2__
29
29
  * Support for reparenting children (and all their progeny)
30
30
  * Support for [concurrency](#concurrency) (using [with_advisory_lock](https://github/mceachen/with_advisory_lock))
31
31
  * Support for polymorphism [STI](#sti) within the hierarchy
@@ -454,6 +454,25 @@ the spec ```tag_spec.rb```:
454
454
  **However, if you're just starting with Rails, may I humbly suggest you adopt a factory library**,
455
455
  rather than using fixtures? [Lots of people have written about this already](https://www.google.com/search?q=fixtures+versus+factories).
456
456
 
457
+ ### There are many ```lock-*``` files in my project directory after test runs
458
+
459
+ This is expected if you aren't using MySQL or Postgresql for your tests.
460
+
461
+ SQLite doesn't have advisory locks, so we resort to file locking, which will only work
462
+ if the ```FLOCK_DIR``` is set consistently for all ruby processes.
463
+
464
+ In your ```spec_helper.rb``` or ```minitest_helper.rb```, add a ```before``` and ```after``` block:
465
+
466
+ ```ruby
467
+ before do
468
+ ENV['FLOCK_DIR'] = Dir.mktmpdir
469
+ end
470
+
471
+ after do
472
+ FileUtils.remove_entry_secure ENV['FLOCK_DIR']
473
+ end
474
+ ```
475
+
457
476
 
458
477
  ## Testing
459
478
 
@@ -472,6 +491,10 @@ Parallelism is not tested with Rails 3.0.x nor 3.1.x due to this
472
491
 
473
492
  ## Change log
474
493
 
494
+ ### 4.2.2
495
+
496
+ * Support attr_accessible and strong_attributes even if you're on Rails 4
497
+
475
498
  ### 4.2.1
476
499
 
477
500
  * Deleting from NumericDeterministicOrdering doesn't create sort order gaps anymore.
@@ -2,14 +2,14 @@ module ClosureTree
2
2
  module SupportFlags
3
3
 
4
4
  def use_attr_accessible?
5
- ActiveRecord::VERSION::MAJOR == 3 &&
5
+ (3..4).include? ActiveRecord::VERSION::MAJOR &&
6
6
  defined?(ActiveModel::MassAssignmentSecurity) &&
7
7
  model_class.respond_to?(:accessible_attributes) &&
8
8
  model_class.accessible_attributes.present?
9
9
  end
10
10
 
11
11
  def include_forbidden_attributes_protection?
12
- ActiveRecord::VERSION::MAJOR == 3 &&
12
+ (3..4).include? ActiveRecord::VERSION::MAJOR &&
13
13
  defined?(ActiveModel::ForbiddenAttributesProtection) &&
14
14
  model_class.ancestors.include?(ActiveModel::ForbiddenAttributesProtection)
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module ClosureTree
2
- VERSION = Gem::Version.new("4.2.1") unless defined?(::ClosureTree::VERSION)
2
+ VERSION = Gem::Version.new("4.2.2") unless defined?(::ClosureTree::VERSION)
3
3
  end
@@ -13,7 +13,7 @@ require 'rspec/rails/fixture_support'
13
13
  require 'closure_tree'
14
14
  require 'tmpdir'
15
15
  require 'coveralls'
16
- Coveralls.wear!
16
+ Coveralls.wear! if ENV['DB_PREFIX'].present? && ENV['DB_SUFFIX'].present?
17
17
 
18
18
  #log = Logger.new(STDOUT)
19
19
  #log.sev_threshold = Logger::DEBUG
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: closure_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew McEachen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-17 00:00:00.000000000 Z
11
+ date: 2013-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord