search for: published_at

Displaying 19 results from an estimated 19 matches for "published_at".

2006 May 27
0
Typo 1055 created_at Vs. published_at
...iencing this and what there thoughts might be on the subject? In Typo 1055, if you use the admin interface and change the published date for an article, you will get "post not found", when you click on the article in the user interface. I belive that the user interface should use the published_at date, instead of the created_at date. The admin interface only allows changes to the published_at date. Using the published_at date in the user interface gives you more control over your blog and how the articles are presented. Here are my suggestions: app/models/blog.rb line 140 def articl...
2010 Apr 12
2
[PATCH] Access to more Arel predicate types from where condition hash
...ates SQL like: SELECT "articles".* FROM "articles" WHERE ("articles"."title" LIKE ''Hello%'') Among other things, this change would prevent it from being necessary to resort to SQL strings in order to achieve something as simple as a a "published_at is not null" where clause. Article.where(''published_at#noteq'' => nil).to_sql SELECT "articles".* FROM "articles" WHERE ("articles"."published_at" IS NOT NULL) It plays nicely with scopes: scope :published, where(''pu...
2006 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
Skipped content of type multipart/alternative-------------- next part -------------- Index: connection_adapters/abstract/connection_specification.rb =================================================================== --- connection_adapters/abstract/connection_specification.rb (revision 4617) +++ connection_adapters/abstract/connection_specification.rb (working copy) @@ -1,10 +1,21 @@ require
2012 Apr 17
6
ActiveRecord with different Date/Time format
...time is parsed wrongly while create/update ActiveRecord. For example user has set date/time format in hh:mm dd/MM/yyyy. Now if user enters 17:00 04/05/2012 it parses it as 5 PM 5 Apr, 2012 where it should be 5 PM 4 May, 2012 1.8.7 :004 > a = Article.create!(:name => ''a1'', :published_at => ''17:00 04/05/2012'') => #<Article id: 2, name: "a1", published_at: "2012-04-05 17:00:00", created_at: "2012-04-16 13:54:36", updated_at: "2012-04-16 13:54:36"> I understand that ruby/rails has predefined set of formats agains...
2006 Apr 20
5
acts_as_taggable patch 3866 needs some testing
...h more usable with this patch. http://dev.rubyonrails.org/ticket/3866 This patch adds scoped finders, documentation, and tests: # Get tags for all articles in a blog @blog.articles.tags # Get tags for articles in a blog published in the last year @blog.articles.tags :conditions => [''published_at > ?'', 1.year.ago] # Get related tags from article tags in a blog @blog.articles.find_related_tags [''code'', ''rails''] # Get blog articles tagged with any/all tags @blog.articles.find_tagged_with :all => [''code'', ''rails...
2010 Aug 05
3
how to ? Rails 3 ActiveRecord eager loading and AREL
...it? Here is a test case : we have an "Article" and a "Comment" Activerecord models, article has many comments comment belongs to article Comment has a scope defined like this (app/models/comment.rb) : ---------------------------------------------- def recent where ["published_at >= ?", 2.days.ago] end ---------------------------------------------- In the ArticlesController (app/controllers/comments_controller.rb) : ---------------------------------------------- def index @articles = Article.includes(:comments) end -------------------------------------------...
2008 Jul 30
2
Mysql "lock wait timeout" tuning
We''re seeing these errors intermittently: ### Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE `chairs` SET `published_at` = NULL, `updated_at` = ''2008-07-30 15:31:05'' WHERE `id` = 2147 [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/ connection_adapters/abstract_adapter.rb:147:in `log'' ### The root issue is probably slowness in the Rails app, which causes some long transactions....
2007 Nov 29
4
collection.build or collection.create gives "ArgumentError: wrong number of arguments (1 for 0)"
...ject that has_many Tasks. Tasks belongs to a Project. When I try the following: project = Project.new project.tasks.build I get: >> s = Project.new => #<Project:0x25f9e28 @attributes={"name"=>"", "end_at"=>nil, "updated_at"=>nil, "published_at"=>nil, "user_id"=>nil, "created_at"=>nil}, @new_record=true> >> s.tasks.build ArgumentError: wrong number of arguments (1 for 0) from /Applications/Locomotive2/Bundles/ standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/ activerecord-1.15.3/lib/a...
2009 Mar 26
0
acts_as_versioned and qa
...thods are also triggering the new version, dispite: self.non_versioned_columns << ''updated_at'' self.non_versioned_columns << ''created_at'' self.non_versioned_columns << ''qa'' self.non_versioned_columns << ''published_at'' How to make the approve! method to start working, while data change should trigger qa reset? Tom PS Here is saple code: class Article < ActiveRecord::Base include AASM aasm_column :qa aasm_initial_state :pending aasm_state :pending aasm_state :approved aasm_state :rej...
2009 Jul 28
1
Rails date conversion
...Record auto-convert to this zone. Auto-convert to this zone... when? Also, what are the differences between these two statements? config.time_zone = xxx config.active_record.default_timezone = xxx I ask these questions because I have a scenario whereby an AR-backed object, when issued the "published_at" method yields a date like "Tue Jul 28 17:04:58 UTC 2009". However, when *finding* the object, e.g. Object.first, I get what looks like a UTC date: "2009-07-28 17:07:11". (That is, when you find an object in console it shows you all its attributes, and it is in there that I...
2011 Aug 21
0
problem with typo6.0.8
...ce (around line *#34*): 31: %></td> 32: <td><%= collection_select_with_current(:search, :user_id, User.find(:all), "id", "name", @search[:user_id].to_i, true) %></td> 33: <td> 34: <%= collection_select_with_current(:search, :published_at, Article.find_by_published_at, "publication", "publication", @search[:published_at], true) %> 35: </td> 36: <td><input type="submit" value=''<%= _("Filter") %>'' class=''ed_button'' /> -- Yo...
2006 Jul 31
0
Patch for #3438: Eager loading doesn''t respect :order of associations
.../3438 == The Solution == My patch adds ~20 lines of code to ActiveRecord::Associations::ClassMethods#construct_finder_sql_with_included_associations which run through the various associations in the join dependency, extract all :order options, expand them to their full form (e.g., ''posts.published_at'' instead of ''published_at'', minding table aliases), and append them to the SQL''s ORDER BY clause, if any exists (creating one if not). == The Catch == Developers who have previously relied on their database''s default order (if any exists) may be unplea...
2011 Feb 05
3
ActiveModel::AttributeMethods limiting
...s(name, klass) # This method will be called once, because of https://github.com/rails/rails/blob/master/activemodel/lib/active_model/attribute_methods.rb#L263 define_attribute_methods([name]) end end class Article < Model property :title property :body property :published_at, Time end In the above example, attribute methods will be defined just for :title. I don''t see any nice workaround. So what is the purpose of AttributeMethods#attribute_methods_generated? I can''t imagine any use case for this. What about removing it entirely and providing #defin...
2007 Jul 19
3
Merb::Controller#url Usage
...ind(1) => #<Article:0x341f2b4 @attributes={"intro"=>nil, "updated_at"=>"2007-07-18 21:31:35", "title"=>"asdf", "body"=>nil, "id"=>"1", "article_attachments_count"=>"2", "published_at"=>nil, "created_at"=>"2007-07-18 21:31:35"}> And an attachment of that article: irb(main):004:0> attachment = article.article_attachments.find(1) => #<ArticleAttachment:0x3410b60 @attributes={"content_type"=>"asdf", "updated_a...
2006 Jun 17
8
Application Design
Hey, I have a system that I am trying to design, it contains news articles, events, etc... There is model representing articles, one representing events, etc... Articles or events can be active or inactive, so I can do a query to return all active articles, all articles or all inactive articles. The question that I have is what would be the best way to design this. Right now I have each
2007 Jul 29
7
Merb test harness
Ezra, * test harness in new generated merb apps with helpers for testing merb without starting a server. * pin down plugin arch Seems to me that these two tasks go together unless you want to have rspec built in Merb. Regarding the test harness, my understanding is that: - a developer should be able to easily write specs against a merb application. - a developer should not need to start a merb
2006 Nov 01
17
So how can I rewrite my app without using with_scope?
So, I hear that with_scope is going to be deprecated. Which is a bit of a shame, given the stuff I''ve been writing recently. I have a CMS with multiple clients. A ''client'' is essentially a company, with multiple users. Content on the site belongs to a client - content could be messages, images, schedules, etc etc. People belonging to one client should not be able
2006 Nov 25
4
Sessions And Active Record
Hi, I''m a newbie even though I''ve play with rails for a few months now. I would like to save several activerecord objects (not in the database) accross several screens. What is the prefered rails way to do this? Should copy all of their data to @session or use the member variables and put them into hidden fields? I am trying to move from "whatever kludge works" to
2011 Oct 18
15
Generate model from database
hello i want to ask, how to generate model from table in my database. That''s possibel ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send