activerecord
Here are 799 public repositories matching this topic...
-
Updated
Jun 1, 2020 - Java
After facing an issue caused by Ransack interpreting 1
/'t'
as true
and some unsuccessful research, I found about the sanitize args and the recommended way to skip them. The documentation never mentions that ransackable_scopes_sanitize_args
must be a class method and the example shown defines an instance method.
I think that's worth a documentation update, making more clear how to use th
I see in the documentatios there is this callbacks, but i didn't understand the purpose and how to use. Can u guys post some examples? Thanks!
old_state before_exit
old_state exit
After generating annotations using the Yard doc format, running migrations does not update the annotations.
Commands
bundle exec annotate --models -f yard
Generates:
# == Schema Information
#
# Table name: users
#
# @!attribute id
# @return []
# @!attribute name
# @return [String]
# @!attribute created_at
# @return [Time]
# @!attribute updated_at
docs wrong
I have found that @activity.trackable
does not work when there is a default_scope
which excludes the tracked object. I found a working monkey patch (see below), though is there a more appropriate solution? Would it be possible to override this default_scope when it's present?
PublicActivity::Activity.class_eval do
def trackable
trackable_type.constantize.unscoped.find trackabl
I see the example for defining settings and mapping for an index/model in the README of https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model:
class Article
settings index: { number_of_shards: 1 } do
mappings dynamic: 'false' do
indexes :title, analyzer: 'english', index_options: 'offsets'
end
end
end
However, I could not find a
Hi there,
I have a codebase that uses establish_connection
. I used Octopus in another (unrelated) part of my app. I did not notice that the parts of the code that used the connection from establish_connection
were affected until I shipped to production. After looking through the codebase I realized that octopus_establish_connection
actually says I do NOT want to use octopus for this connec
-
Updated
Mar 24, 2020 - Ruby
-
Updated
May 11, 2020 - Ruby
The documentation is lacking any usage of .Dispose() (or wrapping with a using() block) on the instantiated sql connections.
e.g. https://sqlkata.com/docs/execution/setup
Is this being called somewhere in the code for you that I'm not seeing?
Otherwise, the documentation/code should be updated to suggest a better way of managing the life-cycle of the connection object. Many people will jus
-
Updated
May 28, 2020 - Java
-
Updated
Jan 6, 2020 - Ruby
-
Updated
May 18, 2020 - Ruby
-
Updated
Apr 30, 2020 - Ruby
-
Updated
Apr 2, 2020 - Ruby
-
Updated
Apr 18, 2020 - Ruby
reconcile config options with TinyTDS and documentation; coerce config values to expected types
reconcile config options with TinyTDS and documentation; coerce config values to expected types
extended discussion at: rails-sqlserver/tiny_tds#461
copied here =>
TinyTDS v2.1.2 and current HEAD
Current State:
At the moment, the only "false" values for these configs are "nil" and the boolean value false
, whereas all non-nil string values, incl
Thanks a lot for this gem, really helpful
We added those to our test suite, ensuring we don't have new database problems in the future.
Here is an example of how we use it :
describe 'Unindexed Foreign Keys' do
before { Rails.application.load_tasks }
let(:allowed) do
{
'users' => ['allowed_id'],
'articles' => %w(other_id allowed_id),
test this in the live example
type 1 in the student name field
expected:
student1 should show (if they exist)
actual:
exception and no records returned
by the time the query reaches search_terms(query), query is of Integer class and query.downcase triggers the error
I'm fixing this with
def self.search_terms(query)
#integer queries are sent through as integer class
-
Updated
Jan 28, 2020 - Ruby
how to:
- How to configure for standalone apps
- Single connection
- Multiple connections
- How to configure using a properties file
- Override form system environment vars
- Override from system properties
- Configure and override in code.
- Configure and override in ActiveWeb apps
- Configure DB-Migrator
- Configure connection pools
In the setup section although this is self explanatory, it might be a good idea to add a piece that simply says: "If you are using a database connection url, change the adapter there too". Just a suggestion.
Cheers!
-
Updated
Apr 16, 2020 - Ruby
Usage examples
Provide some examples (documentation or ruby files) with some common use cases.
e.g.
- Rake task to pull some complex data relationships
- Code snippet of how to export generated inserts to a
.sql
file - Sample
rsync
command to download.sql
files from a remote server - Sample
scp
command
-
Updated
May 17, 2020 - Ruby
Improve this page
Add a description, image, and links to the activerecord topic page so that developers can more easily learn about it.
Add this topic to your repo
To associate your repository with the activerecord topic, visit your repo's landing page and select "manage topics."
For now, there is no mention of Webpack in the official guides – neither on edge guides – except for Ruby on Rails 6 release notes and upgrade guide. The documentation of the Webpacker gem is quite good, but a newcomer to Rails wouldn't know at first that he needs to have a look to it.
Specifically, it would be good to have a mention of Webpack in the following guides: