acts_as_elibri_product 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -110,7 +110,19 @@ example vector:
110
110
  :imprint => {
111
111
  :name => :name
112
112
  }
113
- }
113
+ },
114
+ :related_products => {
115
+ :related_products => {
116
+ :record_reference => :related_record_reference,
117
+ :relation_code => :onix_code
118
+ }
119
+ },
120
+ :front_cover => [
121
+ nil,
122
+ lambda do |product, cover_class|
123
+ product.send(:write_attribute, :cover_link, cover_class.link) if cover_class
124
+ end
125
+ ] #we enter link to cover in field - however remember that hotlinking from eLibri is forbidden - this is just an example
114
126
  ```
115
127
 
116
128
  Also if you want to check for some particular changes in object - you can use policy chain.
@@ -1,3 +1,3 @@
1
1
  module ActsAsElibriProduct
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -127,7 +127,8 @@ module ActsAsElibriProduct
127
127
  end
128
128
  end
129
129
  else
130
- if traverse_vector[change.keys.first].is_a?(Array)
130
+ if traverse_vector[change.keys.first].is_a?(Array) #X X
131
+ next if product.nil? || product_updated.nil? || product.send(change.keys.first).nil?
131
132
  next unless check_policy_chain(self, change.keys.first, elibri_attrib, product.send(change.keys.first).send(elibri_attrib), product_updated.send(change.keys.first).send(elibri_attrib))
132
133
  if traverse_vector[change.keys.first][0].nil?
133
134
  traverse_vector[change.keys.first][1].call(self, product_updated.send(change.keys.first))
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_elibri_product
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Piotr Szmielew
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-18 00:00:00 Z
18
+ date: 2012-10-17 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails