elasticsearch-rails-dynamic-json-support 0.0.2 → 0.0.3

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: 32d652e44a9c8d46c731096776d6a497d9cb8cf3
4
- data.tar.gz: d64a1aae4f1bad05cebcfec376f848024ce6b93f
3
+ metadata.gz: 367857f778e2792b591dff3358f722c8ec514e4e
4
+ data.tar.gz: 2ac98e9a282fbc1d61c914ec8a9795cdc798372b
5
5
  SHA512:
6
- metadata.gz: 1ea410e65b98eaf8d25323a3bb7fccb7fa5d32ea0a24623a7e1c64812048f86d85f2f483d8cded1eaf6403fb63d712e8677059c57a3cd12468199d61197ac445
7
- data.tar.gz: 39525f858190479557b85197654eec43d7b0fea400585bfc005430637dd155940a277654e5b84bff26c347d5d0471515b859d9aeeccdacb31fb9584fca087656
6
+ metadata.gz: 13e20c1edaf97ff676740c706de91455e4062bf0b12abb8a9e90b27b73538fe978d34871645e14d5568f885d8c26c8e349267ddd3c4300c4247f5d52de216e71
7
+ data.tar.gz: b108de4df0ad056798c6d7407fa71b7437188749f6479c148bfbc5701baac768092059b842789534fd5e4594df5b3a32fdb0b687db3b01dc46b214587982546e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: elasticsearch-rails-dynamic-json-support 0.0.2 ruby lib
5
+ # stub: elasticsearch-rails-dynamic-json-support 0.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "elasticsearch-rails-dynamic-json-support".freeze
9
- s.version = "0.0.2"
9
+ s.version = "0.0.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
@@ -41,8 +41,14 @@ module Elasticsearch
41
41
  class_methods do
42
42
 
43
43
  # attributes is a pair of <key, block>
44
- def es_register_attributes attributes
45
- attributes.each do |k, v|
44
+ def es_register_attributes *attributes
45
+ hashed_attributes = attributes.extract_options!
46
+
47
+ attributes.each do |k|
48
+ json_attribute_registry[k] = lambda { |record| record.public_send k }
49
+ end
50
+
51
+ hashed_attributes.each do |k, v|
46
52
  k = k.to_s
47
53
  json_attribute_registry[k] = v || lambda { |record| record.public_send k }
48
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-rails-dynamic-json-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Song Yangyu