When i try to add log_status in my controller part, by default the value
is assigned as 1.
I dont know why it is?
I aslo assigned the value as zero explicitly, like
@log = LogSettings.new
@log.log_status = 0
I would recommend using true and false within your Ruby code because 0 is interpreted as a true value condition. Also, when you access the column within your Ruby code, the following is recommended approach:
if @log.log_status?
# do something for the true case
else
# do something for the false case
end
Note: you'll need to append the '?' onto boolean column's name when accessing it within your code.