immortal 0.1.2 → 0.1.3

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- immortal (0.1.0)
4
+ immortal (0.1.3)
5
5
  activerecord (~> 3.0.3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -44,5 +44,6 @@ If you want to improve immortal
44
44
 
45
45
  ## CHANGELOG
46
46
 
47
+ - 0.1.3 fix bug where join model is not immortal
47
48
  - 0.1.2 fix loading issue when the `deleted` column doesn't exist (or even the table)
48
49
  - 0.1.1 fix behavior with `has_many :through` associations
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "immortal"
6
- s.version = '0.1.2'
6
+ s.version = '0.1.3'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Jordi Romero", "Saimon Moore"]
9
9
  s.email = ["jordi@jrom.net", "saimon@saimonmoore.net"]
@@ -48,7 +48,7 @@ module Immortal
48
48
  # the 'not deleted' scope, otherwise it will take all the rows
49
49
  # from the join model
50
50
  def has_many(association_id, options = {}, &extension)
51
- if options.key?(:through)
51
+ if options.key?(:through) and options[:through].to_s.classify.constantize.arel_table[:deleted]
52
52
  conditions = "#{options[:through].to_s.pluralize}.deleted IS NULL OR #{options[:through].to_s.pluralize}.deleted = ?"
53
53
  options[:conditions] = ["(" + [options[:conditions], conditions].compact.join(") AND (") + ")", false]
54
54
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immortal
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordi Romero