HasRemote 0.1.5 → 0.1.6

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/HasRemote.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{HasRemote}
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sjoerd Andringa"]
12
- s.date = %q{2010-02-18}
12
+ s.date = %q{2010-03-12}
13
13
  s.description = %q{Bind a remote ActiveResource object to your local ActiveRecord objects, delegate attributes and optionally cache remote attributes locally.}
14
14
  s.email = %q{sjoerd.andringa@innovationfactory.eu}
15
15
  s.extra_rdoc_files = [
data/README.rdoc CHANGED
@@ -1,13 +1,13 @@
1
1
  = HasRemote
2
2
 
3
- Gives your local ActiveRecord model an ActiveResource equivalent,
3
+ Binds your local ActiveRecord objects to a remote ActiveResource object,
4
4
  which enables you to look for certain attributes remotely using a RESTful webservice.
5
5
 
6
6
  === Installation
7
7
 
8
8
  As a gem; Add the following to <tt>config/environment.rb</tt>:
9
9
 
10
- config.gem 'HasRemote', :lib => 'has_remote', :version => ">= 0.1.1"
10
+ config.gem 'HasRemote', :lib => 'has_remote'
11
11
 
12
12
  Require the rake tasks from your application's <tt>Rakefile</tt> (only if installed as a gem):
13
13
 
@@ -28,7 +28,7 @@ And only if you require synchronization, run:
28
28
  First make sure your records have a reference to a remote resource:
29
29
  add_column :users, :remote_id, :integer
30
30
 
31
- The default key is 'remote_id', but this can be changed, see options for has_remote.
31
+ The default key is 'remote_id', but this can be changed, see options for <tt>has_remote</tt>.
32
32
 
33
33
  class User < ActiveRecord::Base
34
34
  has_remote :site => 'http://people.local'
@@ -43,7 +43,7 @@ The default key is 'remote_id', but this can be changed, see options for has_rem
43
43
  @user.remote.username
44
44
  # => "User name from remote server"
45
45
 
46
- has_remote optionally takes a block which can be used to specify remote attributes:
46
+ <tt>has_remote</tt> optionally takes a block which can be used to specify remote attributes:
47
47
 
48
48
  class User < ActiveRecord::Base
49
49
  has_remote :site => '...' do |remote|
@@ -67,7 +67,7 @@ The <tt>:through</tt> option enables you to specify your own ActiveResource clas
67
67
  has_remote :through => "RemoteUser"
68
68
  end
69
69
 
70
- See documentation for has_remote for a description of all options.
70
+ See documentation for <tt>has_remote</tt> for a description of all options.
71
71
 
72
72
  === Caching attributes locally
73
73
 
@@ -136,7 +136,7 @@ or from your application's root directory, run:
136
136
 
137
137
  === Testing
138
138
 
139
- To run the specs of the plugin, from the has_remote directory run:
139
+ To run the specs of the plugin, from the HasRemote directory run:
140
140
  rake spec
141
141
 
142
142
  (This requires you to have both RSpec and Shoulda installed.)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -53,7 +53,7 @@ module HasRemote
53
53
  # end
54
54
  #
55
55
  def updated_remotes( options = {} )
56
- time = last_synchronization.try(:last_record_updated_at) || 1.week.ago
56
+ time = last_synchronization.try(:last_record_updated_at) || DateTime.parse("Jan 1 1970")
57
57
  remote_class.find :all, :from => :updated, :params => { :since => time.to_s, :last_record_id => last_synchronization.try(:last_record_id) }.merge( options )
58
58
  end
59
59
 
data/lib/has_remote.rb CHANGED
@@ -18,7 +18,7 @@ module HasRemote
18
18
  # Updates cached attributes, destroys deleted records and adds new records of all models that have a remote.
19
19
  # Also see HasRemote::Synchronizable.
20
20
  #
21
- def self.synchornize!
21
+ def self.synchronize!
22
22
  models.each(&:synchronize!)
23
23
  end
24
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HasRemote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sjoerd Andringa
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-18 00:00:00 +01:00
12
+ date: 2010-03-12 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15