rails-ext 0.3.14 → 0.3.15

Sign up to get free protection for your applications and to get access to all the features.
data/.git/COMMIT_EDITMSG CHANGED
@@ -1 +1 @@
1
- upd
1
+ fix sunspot for MM
data/.git/index CHANGED
Binary file
data/.git/logs/HEAD CHANGED
@@ -65,3 +65,5 @@ b4343d9284a89e2971022f8d4acf7865d8341c6d 824ac01aecaa766ea8a7b10ef9d9f67810fdff4
65
65
  bc8c233044e9ab4299af036c0602bab06d3a5349 f7be86378738705bbd1f97dd8be92c3cc7d54a66 alex <alex@amac.local> 1271938860 +0400 commit: add solr sunspot search
66
66
  f7be86378738705bbd1f97dd8be92c3cc7d54a66 947bf4d6e7e81d5ca62a381caa8d761a9c43cf8a alex <alex@amac.local> 1272045373 +0400 commit: upd mongo
67
67
  947bf4d6e7e81d5ca62a381caa8d761a9c43cf8a e2df18fc21e446588205694aef1de7d63ca31b4f alex <alex@amac.local> 1272144304 +0400 commit: upd
68
+ e2df18fc21e446588205694aef1de7d63ca31b4f cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 alex <alex@amac.local> 1272149564 +0400 commit: fix sunspot for MM
69
+ cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 268fe011dd9d01aa6e05c2004280b78e149ea29e alex <alex@amac.local> 1272149595 +0400 commit: fix sunspot for MM
@@ -65,3 +65,5 @@ b4343d9284a89e2971022f8d4acf7865d8341c6d 824ac01aecaa766ea8a7b10ef9d9f67810fdff4
65
65
  bc8c233044e9ab4299af036c0602bab06d3a5349 f7be86378738705bbd1f97dd8be92c3cc7d54a66 alex <alex@amac.local> 1271938860 +0400 commit: add solr sunspot search
66
66
  f7be86378738705bbd1f97dd8be92c3cc7d54a66 947bf4d6e7e81d5ca62a381caa8d761a9c43cf8a alex <alex@amac.local> 1272045373 +0400 commit: upd mongo
67
67
  947bf4d6e7e81d5ca62a381caa8d761a9c43cf8a e2df18fc21e446588205694aef1de7d63ca31b4f alex <alex@amac.local> 1272144304 +0400 commit: upd
68
+ e2df18fc21e446588205694aef1de7d63ca31b4f cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 alex <alex@amac.local> 1272149564 +0400 commit: fix sunspot for MM
69
+ cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 268fe011dd9d01aa6e05c2004280b78e149ea29e alex <alex@amac.local> 1272149595 +0400 commit: fix sunspot for MM
@@ -51,3 +51,5 @@ b4343d9284a89e2971022f8d4acf7865d8341c6d 824ac01aecaa766ea8a7b10ef9d9f67810fdff4
51
51
  bc8c233044e9ab4299af036c0602bab06d3a5349 f7be86378738705bbd1f97dd8be92c3cc7d54a66 alex <alex@amac.local> 1271938911 +0400 update by push
52
52
  f7be86378738705bbd1f97dd8be92c3cc7d54a66 947bf4d6e7e81d5ca62a381caa8d761a9c43cf8a alex <alex@amac.local> 1272045381 +0400 update by push
53
53
  947bf4d6e7e81d5ca62a381caa8d761a9c43cf8a e2df18fc21e446588205694aef1de7d63ca31b4f alex <alex@amac.local> 1272144311 +0400 update by push
54
+ e2df18fc21e446588205694aef1de7d63ca31b4f cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 alex <alex@amac.local> 1272149569 +0400 update by push
55
+ cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 268fe011dd9d01aa6e05c2004280b78e149ea29e alex <alex@amac.local> 1272149600 +0400 update by push
@@ -0,0 +1,2 @@
1
+ x��K
2
+ 1 @]�� �f�hA� x�4MQ�q�����s7o�x��i�u��6}uύh��je!�*"��ԙшj�Ha����*�J�݊In�J��b6>Ģi_�da ���y��/�:����t<A�=&ʜ��b �������������'u��7hjA�
@@ -0,0 +1,2 @@
1
+ x��K
2
+ �0 ��)�/˱eJ�rŒi ?r��=A7�� ��<�}�x��*�D�5MLAI�]:)`W$����W�*����d��=���
@@ -1 +1 @@
1
- e2df18fc21e446588205694aef1de7d63ca31b4f
1
+ 268fe011dd9d01aa6e05c2004280b78e149ea29e
@@ -1 +1 @@
1
- e2df18fc21e446588205694aef1de7d63ca31b4f
1
+ 268fe011dd9d01aa6e05c2004280b78e149ea29e
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ require 'fileutils'
18
18
 
19
19
  spec = Gem::Specification.new do |s|
20
20
  s.name = "rails-ext"
21
- s.version = "0.3.14"
21
+ s.version = "0.3.15"
22
22
  s.summary = "Set of common Ruby on Rails extensions"
23
23
  s.description = "Set of common Ruby on Rails extensions"
24
24
  s.author = "Alexey Petrushin"
@@ -227,20 +227,17 @@ module Sunspot #:nodoc:
227
227
  unless options[:batch_size]
228
228
  Sunspot.index!(all(:include => options[:include]))
229
229
  else
230
- offset = 0
231
- counter = 1
230
+ batch_size = options[:batch_size]
232
231
  record_count = count
233
- last_id = options[:first_id]
234
- while(offset < record_count)
235
- solr_benchmark options[:batch_size], counter do
236
- records = all(:include => options[:include], :conditions => ["#{table_name}.#{primary_key} > ?", last_id], :limit => options[:batch_size], :order => primary_key)
232
+ page = 1
233
+ while (page - 1) * batch_size < record_count
234
+ solr_benchmark options[:batch_size], page do
235
+ records = paginate(:page => page, :per_page => batch_size, :order => "id")
237
236
  Sunspot.index(records)
238
- last_id = records.last.id
239
237
  end
240
238
  Sunspot.commit if options[:batch_commit]
241
- offset += options[:batch_size]
242
- counter += 1
243
- end
239
+ page += 1
240
+ end
244
241
  Sunspot.commit unless options[:batch_commit]
245
242
  end
246
243
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 14
9
- version: 0.3.14
8
+ - 15
9
+ version: 0.3.15
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alexey Petrushin
@@ -146,6 +146,7 @@ files:
146
146
  - .git/objects/25/ee5ade49ac5dd0ce29f0127d8a3b6d943c981e
147
147
  - .git/objects/25/fa15d9a065f0d6e7ff2756b369c6a81799b03e
148
148
  - .git/objects/26/0e9c6d3781e3ea13d10067398a51a2d5d7bf51
149
+ - .git/objects/26/8fe011dd9d01aa6e05c2004280b78e149ea29e
149
150
  - .git/objects/27/37bd94ff477fad57bb86f0a3e37110f6a75cb5
150
151
  - .git/objects/27/c51d8db9f25b7b6596dceb626252c90fd26b57
151
152
  - .git/objects/27/f8a63386b8acf5edba3ed9334644455045acd8
@@ -182,6 +183,7 @@ files:
182
183
  - .git/objects/36/c7ec2150ecaa7af94d9556c218f723a2eff0e1
183
184
  - .git/objects/37/8d35c31ccb70ca6bbb2fdc2fd4d4d302ff4f41
184
185
  - .git/objects/37/f8dc86fe13f6752dfb6c7880abec894e5a5a35
186
+ - .git/objects/38/60bc71d9acadda183a096c1c8ca36129672ea6
185
187
  - .git/objects/38/fa364fa8743e78ec0fec702b9df1764b42ffc9
186
188
  - .git/objects/3a/03b9d44de43472689300120ffb2a0a9a74f27f
187
189
  - .git/objects/3a/797683953be7e6d0ffa0e34514f3e8e9c3ceb0
@@ -359,6 +361,7 @@ files:
359
361
  - .git/objects/8e/3cfb391de711b5fecfbdf2860fa37b019e8036
360
362
  - .git/objects/8e/69b6cf3ec8b49270091b4a206ccf326679dc20
361
363
  - .git/objects/8e/a47de58a27dd343b3ecd3dd5e0fab88e268a72
364
+ - .git/objects/8e/fa16421582098dd9791648690ad67b30217f72
362
365
  - .git/objects/8f/53b7b2ab88b130763bc42b3ded7983d27bff7a
363
366
  - .git/objects/8f/5465ea782955ad019122d92a0f162945339f8e
364
367
  - .git/objects/90/57dd59aea225dd8f4b1dfa3e10c6096671fab9
@@ -466,6 +469,7 @@ files:
466
469
  - .git/objects/be/29c116694d85d48cf177cf30816aa159189536
467
470
  - .git/objects/be/4935dda5362a24e6fae89d4cd8f3cb2d302d01
468
471
  - .git/objects/c0/22e88f31b91cecfc45b1bae611c27f5b12ca15
472
+ - .git/objects/c0/6835afc7627a9a401fe6a2118721857db3aeb5
469
473
  - .git/objects/c0/724bc45e241d336d6376f14d9b258c2e4744d4
470
474
  - .git/objects/c1/3cf3c2ea85ec40544fe31702b2cfe6091aed6e
471
475
  - .git/objects/c1/424cadd8817a7e927742e52945f303b38e7222
@@ -495,6 +499,7 @@ files:
495
499
  - .git/objects/cb/52d0a9c9540d1d9aba011e8445d57236dafb74
496
500
  - .git/objects/cc/526ac5557b0d8d6b94adbb6ef656cd68d3657d
497
501
  - .git/objects/cc/631f0ac75233f9984bbe8fadc701c3275edc20
502
+ - .git/objects/cd/a2dd4b5ecbc69fa1b1ebf09c580ba17bf69656
498
503
  - .git/objects/cd/cf979816bbea77b6000145a1e23921553bf497
499
504
  - .git/objects/ce/558ace2912de6c83d5d7e9d49f3606af6babcf
500
505
  - .git/objects/ce/765d12145624d05ff844166237788fd200aa22
@@ -561,6 +566,7 @@ files:
561
566
  - .git/objects/e8/901c48443ed6999a3c1b86c435562d2ee54caf
562
567
  - .git/objects/e8/e3794adaa5886984bd0c0ff90980353de03c9b
563
568
  - .git/objects/e9/46302310acac8a7a6b64a58b47062934765ede
569
+ - .git/objects/e9/f443234dd56456d6663223054ae552c44df024
564
570
  - .git/objects/ea/50407bf8daef694d22268540dd55eb3a739bad
565
571
  - .git/objects/eb/950b1535bf0671019ba323386deea2598ce246
566
572
  - .git/objects/eb/9701e2dbe8fb606315f9514d789188160bdd67
@@ -596,11 +602,14 @@ files:
596
602
  - .git/objects/f9/ef6dd08a60dec5d5e4e7a9b08f693ebf76da39
597
603
  - .git/objects/fa/32b67bfde929653fae09b9e1f7c813aad41775
598
604
  - .git/objects/fa/4e345a8b9a12bf1cf7af254b3caa111b04191b
605
+ - .git/objects/fa/5f74de5e0d05f4df22d19732e329d6baf2ef42
599
606
  - .git/objects/fa/854db299be87a6e6a65d906e7c2f9b122d9980
600
607
  - .git/objects/fb/05e1cc9825c59c7edc596c05077a1eed9c321e
601
608
  - .git/objects/fc/022a0a2ed82b2361292833c0cb90f996aae858
602
609
  - .git/objects/fc/269675339310e8f1ade1282978274f7da2713c
610
+ - .git/objects/fc/57fb9c7c3071095af9657d1cca26afaf5f258e
603
611
  - .git/objects/fc/bf66b949d823f884d1aff2f3e192943cb195a2
612
+ - .git/objects/fd/066ab33785d26d7c6728d2651bfd560da5bdd1
604
613
  - .git/objects/fd/25e0c8e44fb97a7c7d76280cec51886b51abf6
605
614
  - .git/objects/fe/c19d13244f6b439e234e1af2e2e6d1f886b2fb
606
615
  - .git/objects/fe/ce95626cedcc0682e6fcc20fe019aab60938f2