ruby tag

542 questions


1 answers
89 views
0
Transaction processing with multiple model updates in one set is not successful in rails

I would like to transact multiple model updates as a lump.Let's say two models work when you do things like account transfer processing.AccountTransaction models include Payment side account id(withdr...

2 years ago

2 answers
92 views
0
Ruby always runs while the first time

while false puts1endEven under these conditions, ruby does not have a while to run at least once.

2 years ago

1 answers
113 views
0
I want to scrape with ruby, but I can't require mechanize.

When I try to scrape and run it, it looks like this.I'm in trouble because I don't understand even if I look into it.Please give me a solution.$ruby scraping_image.rb/Users/000/.rbenv/versions/2.3.1/l...


2 answers
84 views
0
Questions about the initialize method for the ActiveRecord::Relation class.

This method basically initializes various instance variables, but after running @values=values while examining self in the process of initializing instance variablesI noticed that what self is pointin...

2 years ago

1 answers
124 views
0
rakedb —Error during migration

Prerequisites/What you want to achieveI want to resolve the error and migrate it.Problems/Error Messages you are experiencingI tried to rake db:migrate in Migrate membership function to create a datab...

2 years ago

2 answers
90 views
0
Can object-oriented in C language?

The word feeling structure came out, but I didn't really understand it.For example, what happens if I use C to represent Ruby's code below?class HogeModule def hoge endendclass HogeClass include Hoge...

2 years ago

1 answers
51 views
0
Rails Select Box Does Not Work Using MaterializeCSS

We are currently developing in the following environments:Ruby: 2.3.1Rails:5.0.0I am using MaterializeCSS, but the Select box does not work.It appears, but cannot be pulled down.Many research shows th...

2 years ago

1 answers
81 views
0
Want to create a Ruby development environment (if you already have Win7, XAMPP-PHP environment)

Currently, Windows 7 contains XAMPP-PHP, Apache, and mySQL.I would like to create a Ruby development environment on this PC, but I would like to be able to use the two differently.If you know how to b...

2 years ago

2 answers
113 views
0
How to Test the Private Method of the Model

modelclass test  def initialize(val1,val2)    validate(val1,val2)  end  private   def validate(val1,val2)    raise xxxx errorless val1.presnet?    raise yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy  ...

2 years ago

1 answers
88 views
0
Is there a method that returns true with the specified probability in Ruby?

It's just as the title says.For the time being, we are working on the following items.def hoge(n) # Generate an array with a true pair false of n to 100-n and randomly select one ([true]*n + [false]*(...

2 years ago
« - 8 - »

© 2024 OneMinuteCode. All rights reserved.