rails-activerecord
Rails Observer Not Working
I am trying to use observers in my rails app to create a new entry in my \"Events\" Model every time a new \"Comment\" is saved. The comments are saving fine, but the observer is not creating events p[详细]
2023-01-17 04:30 分类:问答How to chain scope queries with OR instead of AND?
I\'m using Rails3, ActiveRecord Just wondering how can I chain 开发者_JS百科the scopes with OR statements rather than AND.[详细]
2023-01-15 20:46 分类:问答Disable SQL Cache temporary in Rails?
I\'m currently creating a Rails app with some cronjobs etc, but I have some problems because the sql is cached by Rails.[详细]
2023-01-14 07:20 分类:问答ActiveRecord OR query
How do you do an OR query in Rails 3 ActiveRecord. All the examples I find just have AND queries. Edit: OR meth开发者_如何学JAVAod is available since Rails 5. See ActiveRecord::QueryMethods[详细]
2023-01-14 04:18 分类:问答Relating two models and accessing them with a single controller in Rails
Background: I am playing around with the feedzirra plugin in a rails app, and I am attempting to utilize both the feed and entry accessors of the parsed feed in a single view.[详细]
2023-01-11 09:19 分类:问答How to get record created today by rails activerecord?
How should I write开发者_JAVA技巧 the conditional statement for when I want to get all the records which were created today?Post.where(created_at: Time.zone.now.beginning_of_day..Time.zone.now.end_of_[详细]
2023-01-01 00:54 分类:问答Random record in ActiveRecord
I\'m in need of getting a random record from a table via ActiveRecord. I\'ve followed the example from Jamis Buck from 2006.[详细]
2022-12-29 01:34 分类:问答Delete records from table which matches the data in an array?
I have a table of 2 fields. Word and timestamp. Then i have this array which contains some words. How do i delete all the records in the table which match with the words in the array?[详细]
2022-12-23 12:02 分类:问答Rails ActiveRecord date between
I need to query comments made in one day. The field is part of the standard timestamps, is created_at. The selected date is comin开发者_如何学Gog from a date_select.[详细]
2022-12-22 10:09 分类:问答Ruby on Rails: :include on a polymorphic association with submodels
When working with a polymorphic association, is it possible to run an include on submodels that are only present in some types?[详细]
2022-12-22 05:46 分类:问答