loyal_core 0.0.8 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
|
-
|
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
|
-
|
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
|
|
data/lib/loyal_core/engine.rb
CHANGED
data/lib/loyal_core/version.rb
CHANGED
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.
|
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-
|
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:
|
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:
|
541
|
+
hash: -172726748522545
|
525
542
|
requirements: []
|
526
543
|
rubyforge_project:
|
527
544
|
rubygems_version: 1.8.25
|