seamusabshere-has_timestamps 1.5.4 → 1.5.5

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.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 5
3
- :patch: 4
3
+ :patch: 5
4
4
  :major: 1
@@ -30,7 +30,7 @@ module HasTimestamps
30
30
  end
31
31
  end
32
32
 
33
- has_many :timestamps, opts.merge(:class_name => 'HasTimestamps::Timestamp', :as => :timestampable) do
33
+ has_many :timestamps, opts.merge(:class_name => '::Timestamp', :as => :timestampable) do
34
34
  def [](key)
35
35
  t = fetch_timestamp(key, false)
36
36
  t.stamped_at unless t.nil?
data/lib/timestamp.rb CHANGED
@@ -1,28 +1,26 @@
1
- module HasTimestamps
2
- class Timestamp < ActiveRecord::Base
3
- class << self
4
- def create_table
5
- self.connection.create_table(:timestamps) do |t|
6
- t.integer :timestampable_id
7
- t.string :timestampable_type
8
- t.string :key
9
- t.datetime :stamped_at
10
- t.timestamps
11
- end
1
+ class Timestamp < ActiveRecord::Base
2
+ class << self
3
+ def create_table
4
+ self.connection.create_table(:timestamps) do |t|
5
+ t.integer :timestampable_id
6
+ t.string :timestampable_type
7
+ t.string :key
8
+ t.datetime :stamped_at
9
+ t.timestamps
12
10
  end
11
+ end
13
12
 
14
- def drop_table
15
- self.connection.drop_table(:timestamps)
16
- end
13
+ def drop_table
14
+ self.connection.drop_table(:timestamps)
17
15
  end
16
+ end
18
17
 
19
- belongs_to :timestampable, :polymorphic => true
18
+ belongs_to :timestampable, :polymorphic => true
20
19
 
21
- validates_presence_of :key, :timestampable_id, :timestampable_type
22
- validates_uniqueness_of :key, :scope => [ :timestampable_id, :timestampable_type ]
20
+ validates_presence_of :key, :timestampable_id, :timestampable_type
21
+ validates_uniqueness_of :key, :scope => [ :timestampable_id, :timestampable_type ]
23
22
 
24
- def to_param
25
- self.key
26
- end
23
+ def to_param
24
+ self.key
27
25
  end
28
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seamusabshere-has_timestamps
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere