cowtech-rails 1.6.0.0 → 1.6.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,10 @@ module Cowtech
20
20
  0
21
21
  end
22
22
 
23
+ def self.[](what, only_id = false)
24
+ self.__finalize_record(self.__index_find(what), only_id)
25
+ end
26
+
23
27
  def safe_id
24
28
  if self.id then self.id else 0 end
25
29
  end
@@ -51,6 +55,27 @@ module Cowtech
51
55
  super()
52
56
  end
53
57
  end
58
+
59
+ def ==(other)
60
+ if other.class.to_s != self.class.to_s then
61
+ self.id == self.class.__index_find(other).id
62
+ else
63
+ super
64
+ end
65
+ end
66
+
67
+ def !=(other)
68
+ ! (self == other)
69
+ end
70
+
71
+ private
72
+ def self.__index_find(what)
73
+ self.find(what)
74
+ end
75
+
76
+ def self.__finalize(record, only_id = false)
77
+ only_id ? record.id : record
78
+ end
54
79
  end
55
80
  end
56
81
  end
@@ -9,7 +9,7 @@ module Cowtech
9
9
  module Version
10
10
  MAJOR = 1
11
11
  MINOR = 6
12
- PATCH = 0
12
+ PATCH = 1
13
13
  BUILD = 0
14
14
 
15
15
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 6
8
+ - 1
8
9
  - 0
9
- - 0
10
- version: 1.6.0.0
10
+ version: 1.6.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shogun