loyal_core 0.0.8 → 0.0.10

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.
@@ -0,0 +1,30 @@
1
+ class ActsAsTaggableOnMigration < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :tags do |t|
4
+ t.string :name
5
+ end
6
+
7
+ create_table :taggings do |t|
8
+ t.references :tag
9
+
10
+ # You should make sure that the column created is
11
+ # long enough to store the required class names.
12
+ t.references :taggable, :polymorphic => true
13
+ t.references :tagger, :polymorphic => true
14
+
15
+ # Limit is created to prevent MySQL error on index
16
+ # length for MyISAM table type: http://bit.ly/vgW2Ql
17
+ t.string :context, :limit => 128
18
+
19
+ t.datetime :created_at
20
+ end
21
+
22
+ add_index :taggings, :tag_id
23
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
24
+ end
25
+
26
+ def self.down
27
+ drop_table :taggings
28
+ drop_table :tags
29
+ end
30
+ end
@@ -22,12 +22,21 @@ module LoyalCore
22
22
 
23
23
  # space 格式要求正确
24
24
  validates_format_of :space, :with => PERMALINK_REGEXP, :multiline => true
25
- validates_uniqueness_of field_name, :uniqueness => {:scope => [:space]}
25
+
26
+ if options[:paranoid]
27
+ self.validates_uniqueness_of_without_deleted field_name, :scope => [:space]
28
+ else
29
+ validates_uniqueness_of field_name, :uniqueness => {:scope => [:space]}
30
+ end
26
31
  else
27
32
  validates_format_of field_name, :with => PERMALINK_REGEXP, :multiline => true
28
33
  validates_presence_of field_name
29
34
 
30
- validates_uniqueness_of field_name
35
+ if options[:paranoid]
36
+ self.validates_uniqueness_of_without_deleted field_name
37
+ else
38
+ validates_uniqueness_of field_name
39
+ end
31
40
  end
32
41
  end
33
42
 
@@ -26,7 +26,9 @@ require 'kaminari' # 分页插件
26
26
  # 图片上传
27
27
  require 'carrierwave'
28
28
  # gem 'carrierwave-mongoid'
29
- require'mini_magick'
29
+ require 'mini_magick'
30
+
31
+ require 'acts-as-taggable-on'
30
32
 
31
33
  module LoyalCore
32
34
  class Engine < ::Rails::Engine
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module LoyalCore
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.10"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loyal_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-09 00:00:00.000000000 Z
12
+ date: 2013-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: protected_attributes
@@ -331,6 +331,22 @@ dependencies:
331
331
  - - ">="
332
332
  - !ruby/object:Gem::Version
333
333
  version: '0'
334
+ - !ruby/object:Gem::Dependency
335
+ name: acts-as-taggable-on
336
+ requirement: !ruby/object:Gem::Requirement
337
+ none: false
338
+ requirements:
339
+ - - ">="
340
+ - !ruby/object:Gem::Version
341
+ version: '0'
342
+ type: :runtime
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ none: false
346
+ requirements:
347
+ - - ">="
348
+ - !ruby/object:Gem::Version
349
+ version: '0'
334
350
  - !ruby/object:Gem::Dependency
335
351
  name: rails
336
352
  requirement: !ruby/object:Gem::Requirement
@@ -453,6 +469,7 @@ files:
453
469
  - db/migrate/20130610091558_create_loyal_core_skin_folders.rb
454
470
  - db/migrate/20130413061851_create_kindeditor_assets.rb
455
471
  - db/migrate/20130610095635_create_loyal_core_skin_recipes.rb
472
+ - db/migrate/20130811062658_acts_as_taggable_on_migration.rb
456
473
  - db/migrate/20130610095938_create_loyal_core_skin_dishes.rb
457
474
  - db/migrate/20130331104216_create_loyal_core_rating_tracks.rb
458
475
  - lib/loyal_core/active_model/strip_whitespace.rb
@@ -512,7 +529,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
512
529
  version: '0'
513
530
  segments:
514
531
  - 0
515
- hash: 7514622954336013
532
+ hash: -172726748522545
516
533
  required_rubygems_version: !ruby/object:Gem::Requirement
517
534
  none: false
518
535
  requirements:
@@ -521,7 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
521
538
  version: '0'
522
539
  segments:
523
540
  - 0
524
- hash: 7514622954336013
541
+ hash: -172726748522545
525
542
  requirements: []
526
543
  rubyforge_project:
527
544
  rubygems_version: 1.8.25