sevenseacat: I don???t ahve an error, I know from experience if you write where clauses like that, they fail if there are conflicting column names because ActiveRecord traditionally fully qualifies SQL columns with the table name, which is important for joins that have the same column names
I was just wondering what is the correct way to write queries with joins, which require custom where clauses
Hi. I???m calling model.update_attribute(:foo, ???bar???) when model.foo might already be bar. In the case that it???s not it does useful work, in the case that it???s the same, it makes an empty transaction which isn???t very efficient. In those cases, I???ve manually wrote model.foo = ???bar???; model.save if model.changed? but this feels a bit dirty. What is the best way to do this efficiently?
smathy: also we are running over ssh in some cases and it takes up to 40ms rount trip
It seems inefficient and even stupid to have empty transactions if it isn???t required
Hello, I'm using active record. I have a parent class, say, MapPoint and a child class Category. MapPoint has many Category. When categories are added or removed, I need to update the MapPoint#icon field. What is the correct way to do this using before/after_save that handles the following cases, when creating a new MapPoint from scratch, and when only adding new Categories
The first case is relatively easy because icon is nil initially, and when saving a map point all the categories are known
How do I know in the second case, whether MapPoint is being saved when I'm in the Category after_save callback - if it's being saved, I can modify the map point from category and it should get persisted right?
Xeago_, sure that makes sense, but it doesn't match up with reality, i.e. "x".split('.') gives ['x'] and ['x'].join('.') gives 'x', which is exactly the same as if it was just whitespace
i.e. "".split('.') -> [''] and [''].join('.') gives '' which is absolutely valid
unfortunately in Ruby's case "".split('.') gives  which is an edge case and is documented
If you close the terminal emulator, the master end of the pty becomes closed; the foreground process group of the slave end receives SIGHUP and likely dies. If you press Ctrl+D at the shell, the slave end of the pty becomes closed, the terminal emulator gets EOF on the master end, and shuts down accordingly.