common_models 0.0.0 → 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/article.rb +39 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 276b28564e2c177688d150c3aedcaaaf90382c57
4
- data.tar.gz: 193a26b1d352fb107e5d8e53c88858bff16fcce6
3
+ metadata.gz: 50cfe18b1937a479984e9d40bdab74dc1a42fdc8
4
+ data.tar.gz: a85446ec5982e7e7f15998d97d76540a03d01de2
5
5
  SHA512:
6
- metadata.gz: 76a66f908dc9e1bd382f8df6662518d5bebb7ef2adc093ae8086f2b4e4605af6900993e6130da5e7d4921a5942916157f30e014dcc99601ac5bb01b7ddad3194
7
- data.tar.gz: b392c59533de2e8bde1296f6c18f215b42de0c805ef8bfa8dc2255d47a399693d0609d359df3b3563a21a9c7f7a6c28aab7945e298838c32ad4dfae7156a236c
6
+ metadata.gz: 1661a27f96d2c63ebb11a2a5638f04c316676f23bb4b9724b5ceaf44f0445d2ffa85db2edb2aff5aed9877460d2e920a9c04ae7de270d01b430c4b52d3dc1e34
7
+ data.tar.gz: 222296b457c2c96198337a893ff25f96537cbb9017d4306340b249447951bd717d6aa8d25869e10a067b05741b726ac3274b1a853ddd865e357d194d42ba9c0a
@@ -0,0 +1,39 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: articles
4
+ #
5
+ # id :integer not null, primary key
6
+ # title :string default(""), not null
7
+ # content :text
8
+ # category :string default(""), not null
9
+ # status :integer default(0), not null
10
+ # file_fj :string
11
+ # manager_id :integer
12
+ # created_at :datetime not null
13
+ # updated_at :datetime not null
14
+ # source :string default(""), not null
15
+ # slideshow :integer default(0), not null
16
+ # file_image :string
17
+ # file_thumbnail :string
18
+ # rank :integer default(0), not null
19
+ # page :string default(""), not null
20
+ # direction :string default(""), not null
21
+ #
22
+
23
+ class Article < ActiveRecord::Base
24
+ resourcify
25
+
26
+ belongs_to :manager
27
+ has_many :article_category_relationships, :dependent => :destroy
28
+ has_many :article_categories, :through => :article_category_relationships
29
+
30
+ mount_uploader :file_fj, OrganizationUploader
31
+ mount_uploader :file_thumbnail, ImageUploader
32
+ mount_uploader :file_image, ImageUploader
33
+
34
+ validates :title, :presence => true
35
+ validates :content, :presence => true
36
+ # validates :category, :presence => true
37
+ # validates :page, :presence => true
38
+ validates :source, :presence => true
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Di.Diao
@@ -16,6 +16,7 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - app/models/article.rb
19
20
  - lib/common_models.rb
20
21
  homepage: http://rubygems.org/gems/common_models
21
22
  licenses: []