embark-journey 0.0.8 → 0.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 903b83a147f53c1efba286cf039543a5c908ad1d
4
- data.tar.gz: 0a87f6e082c435ca7f20851b3ec16faa71ce0ba8
3
+ metadata.gz: 9fa7f4099b371cb91581b51ad9ddd78938dd6283
4
+ data.tar.gz: 1f96fd382c67828f29a632c51ba8764c7c6ba6be
5
5
  SHA512:
6
- metadata.gz: b1816e1461c44ffd10324977f097a94c01cc844f26a171c9b84da4ae8e2dd856fefe3c62b1ca1306e7eeb5a9646b084b97cdad9779376c3de293713b2c7295ce
7
- data.tar.gz: d987784dae2d9bde8e8738091000d989c9e9aa245029672a545b15d30b3e388e6712e83da3713107663ee186c1ac30a3a265017eba5d1ac82951013752592102
6
+ metadata.gz: 82cbbdab31d16755611fbf429e642eac1df94ddc7a7ce0cac1ba4296ebbff64ee476d250abfa72edd3415588df58a44c9e596086e96efd96c95ba05a48fdca42
7
+ data.tar.gz: e8b672cff0b27d786cbed452db6c6c9e34030f1d6863c3f334657cf5a23610d4a638c326f59df982ca89331d9ea34b3ee1fd82834430cb94ca2840867b36ecf1
data/CHANGELOG.md CHANGED
@@ -0,0 +1,3 @@
1
+ v0.0.9
2
+ - Rescues from ActiveResource::ResourceNotFound when association_id is set but object doesn't exist
3
+ - Fixes embeds for associations with names different from their class
@@ -132,7 +132,7 @@ module ActiveResource::Associations
132
132
  attributes[method_name]
133
133
  elsif association_id = send(finder_key)
134
134
  return nil if association_id.blank?
135
- instance_variable_set(ivar_name, association_model.find(association_id))
135
+ instance_variable_set(ivar_name, (association_model.find(association_id) rescue nil))
136
136
  end
137
137
  end
138
138
 
@@ -145,7 +145,7 @@ module ActiveResource::Associations
145
145
  attr_accessor :embeds
146
146
  def defines_belongs_to_embed(method_name, association_model, foreign_key)
147
147
  self.embeds ||= []
148
- self.embeds << association_model.to_s.underscore
148
+ self.embeds << method_name.to_s
149
149
  end
150
150
 
151
151
  def defines_has_many_finder_method(method_name, association_model)
@@ -2,7 +2,7 @@ module Journey
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 8
5
+ TINY = 9
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embark-journey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Davey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-21 00:00:00.000000000 Z
11
+ date: 2014-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_attr