Module: Blogit::Blogs::ClassMethods
- Defined in:
- lib/blogit/blogs.rb
Instance Method Summary collapse
-
#blogs ⇒ Object
When called within a model (usually User) this creates a has-many assosciation between the model and Post.
-
#blogs? ⇒ Boolean
Has this model been registered as a blogging model?.
Instance Method Details
#blogs ⇒ Object
When called within a model (usually User) this creates a has-many assosciation between the model and Post
10 11 12 13 |
# File 'lib/blogit/blogs.rb', line 10 def blogs @blogs = true has_many :blog_posts, :as => "blogger", :class_name => "Blogit::Post" end |
#blogs? ⇒ Boolean
Has this model been registered as a blogging model?
Returns true or false
18 19 20 |
# File 'lib/blogit/blogs.rb', line 18 def blogs? @blogs == true end |