Activerecord Questions
Ad
Get Rails Activerecord to use external API id for database
I have my project making api fetches for "things" from my react front end and placing them in my redux state. when someone wants to add a review
How to use Rails'Active Record in a separated script.rb?
I have to run this script: /scripts/savedata.rb and in it, i need to use activerecord of my rails application. i
Rails Resource Restful Routes Helper functions and nil oject error
I am getting an error when trying to use the resource route helper functions <%= link_to_remote "delete", { :method
How can I count the number of records that have a unique value in a particular field in ROR?
I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set. something
Main pricing and support for custom client pricing (Database Architecture ideas help - Rails)
I have a personal project i'm planning and i came to a small hurdle. i want to have an item with price that will be the default for all
Using helpers in model: how do I include helper dependencies?
I'm writing a model that handles user input from a text area. following the advice from
Rails ContactForm with non ActiveRecord model - validations
Can anyone share a few guides, tips or links to what constitute best practices for creating a model that represents a contact form which is not
What does the "-" mean in front of a ruby symbol?
When i had a look into the activerecord source today, i stumbled upon these lines
Unable to load the requested file: home.php
In the codeigniter i get this message : unable to load the requested file: home.php
Ruby Rails User's Email Being overwritten
Playing around with authentication from scratch and for some reason my users email address is not being saved to the db. when i fire up the
Ad
returning just a key from a hash field
I have an activitypart model that has a field called activity_json. this field is a hash and has a key named "image". how do i select
How does ActiveRecord::Error.type affect validation error messages?
Here's a code fragment from a rails project i am working on: if has_youtube &&
Best Practice for querying data from foreign table in Rails API for React
So i am building a web app with a rails backend and a react frontend. on my meals#index page, i want to display all my meals
Why is Eloquent not seeing all fields in my model when inserting into the database
I'm new to laravel development and am trying to create an eloquent model backed by an sqlite database. i have the following code on my local
Rails active record call with parameters?
My app uses searchkick with elasticsearch to return aggregations (as in the breakdown of categories etc) from your search which i use to build
Rails 4 - how do I query on a collection through a has_many association with multiple conditions on the same columns?
Here's some context - let's say i have the following relationships: class session < activerecord::base has_many :events
Should I use the foreign_key clause both in has_many as in belongs_to?
I have two models. office and employee. employee has office_id as foreign_key. the tables was
Why all the Active Record hate?
As i learn more and more about oop, and start to implement various design patterns, i keep coming back to cases where people are hating on
Rails database design with or without associations
Question about database design with rails. i wanted to know if i'm on the right track or if i'm making things overtly complicated.
Rails Association Terminology: Belongs_to and has_many
I have two questions about activerecords: 1) let's say i have an application with several users, each one of which has a profile
ActiveRecord: Order by firstcolumn, (secondcolumn='foobar'), thirdcolumn...possible?
I have an activerecord query that works as follows: a user searches for a zipcode - let's say 90210. the query then identifies the state
Ad
Octobercms: clear $attachOne relationship
I have a problem updating an attachone relation of a model from a frontend form under octobercms. i have a
How to chain DB relationships in Laravel (multiple has_many?)
I'm using laravel, which is awesome, but i'm stuck on an issue with the database. let's say we have three tables, like so:
Ruby on Rails: How do I execute a function before saving to the database?
I want to alter the data and save it then to the database when using the new / create function of the app.
Find entry where value does not intersect with other value
I am having issues making an activerecord query in ruby on rails that gives me back all users, whose blocked_dates (autogenerated
How to save multiple records at once into a database
I have a foreach that loops through a number of objects and then creates a record in the database for each item.
Ruby on Rails: A way to save currency into a column within a database-table
I have a database-table cost with the columns amount and currency. i search for a solution to save a currency into this column. what do
Rails db fields not updating properly
I'm trying to write get increment/decrement methods working for a fairly simple class and im running into a strange issue. if i call
yii2 ActiveRecord Find OrderBy with calculation
Trying to fetch a description from my database. the query returns the result but i would like to order the result to only show the one with the
codeigniter ActiveRecord method convert to query
Is there any online converter which converts active record method into raw sql query? for example i have this method :
Group by Week and Count Column Values in Rails
Looking to do a simple-ish sql query in rails (using active record) and i'm running into some trouble. i want to return a json response so
Rails 4 connect to remote MySQL database and pull Database structure for easy access
In my team, we are developing a system that is accessed by different platforms such as a ruby on rails website, a desktop java application and
Ad
Phusion Passenger - ActiveRecord::PendingMigrationError
I am trying to run simple ror application with phusion passenger. at the moment when go to localhost i see the error from subject. in fact i don't
Get all columns of each distinct records in rails
I want to get distinct records in rails. for that i see
Reduce two SQL queries to one in activerecord maybe using joins
Two models user and article have a relation as: user has_one article article belongs_to
Rails Slow Postgres Query with Order using Index
I am doing a query on my database of a few million items that gets really slow when i add in an order. here is the code i am calling:
Filtering Active Resource Objects Using Where Clause
I am looking to build a basic shopify app using ruby on rails. i am using the shopify_app gem to faciliate my api calls to shopify.
Get transactions in batches ShopifyAPI
Is it possible to retrieve transactions in batches? i currently retrieve orders using: shopifyapi::order.find(:all, params: {ids: order_ids.join(',')})
Ad
Blog Categories
Ad